Uploads¶
- class astrometry_net_client.uploads.BaseUpload(session: Session, *args, **kwargs)¶
Extends from:
astrometry_net_client.request.AuthorizedRequest
,
Base class for uploads to be made with the Astrometry.net API. Combines some abstact classes useful for an upload request (e.g. a submit method, default post request and authorization)
Meant as an abstact/base class, not to be called directly.
- class astrometry_net_client.uploads.FileUpload(filename: str, *args, **kwargs)¶
Request for submitting a file
Extends from
BaseUpload
Class for uploading a file to Astrometry.net upload file endpoint
Example
>>> s = Session(api_key='XXXXX') >>> upl = FileUpload('some/file', session=s) >>> submission = upl.submit()
You can then use the resulting submission to inspect the result of your upload.
- Parameters:
filename (str) – The path to the file which you want to upload.
session (
astrometry_net_client.session.Session
) – The login session (required by theastrometry_net_client.request.AuthorizedRequest
class)
- Returns:
The submission object, which is created when you upload a file.
- Return type:
- class astrometry_net_client.uploads.SourcesUpload(session: Session, *args, **kwargs)¶
Extends from
BaseUpload
Class for uploading a list of sources. (inspired by astroquery implementation)
- class astrometry_net_client.uploads.Submitter¶
Abstract class intended to use as a mixin class with a Request object (and hence assumes a _make_request method). Provides a new submit method, similar to make, but creates a Submission object out of the resulting response (from the subid entry).
Example
>>> upl = FileUpload(filename, session) >>> submission = upl.submit()
- submit() Submission ¶
Submit function, similar to
make
but in addition creates and returns the resulting submission.- Returns:
The submission which is created by the API. Use this to get the status & result(s) of your upload.
- Return type:
- class astrometry_net_client.uploads.URLUpload(session: Session, *args, **kwargs)¶
Extends from
BaseUpload
Class for making a url upload to Astrometry.net http://astrometry.net/doc/net/api.html#submitting-a-url
Work in progress