needlestack.data_sources package¶
Submodules¶
needlestack.data_sources.gcs module¶
-
class
needlestack.data_sources.gcs.GcsDataSource[source]¶ Bases:
needlestack.data_sources.source.DataSourceData source that lives locally on disk as a file.
-
bucket_name¶ Google Cloud Storage bucket name
-
blob_name¶ Blob name in bucket
-
project_name¶ Google Cloud Platform project name
-
credentials_file¶ JSON credentials file for GCP. If not provided, the google.cloud package will try to get the credentials implicitly
-
property
blob¶ - Return type
Blob
-
property
last_modified¶ Last time a data source was modified
-
-
needlestack.data_sources.gcs.get_client(credentials_file=None)[source]¶ Gets a cached GCS client, or creates and caches a GCS client. If not provided a credentials file, checks the environment variables for client authentication.
- Parameters
credentials_file (
Optional[str]) – Path to GCP credentials json- Return type
Client
needlestack.data_sources.local module¶
-
class
needlestack.data_sources.local.LocalDataSource[source]¶ Bases:
needlestack.data_sources.source.DataSourceData source that lives locally on disk as a file
-
filename¶ Filename on disk
-
property
last_modified¶ Last time a data source was modified
-
needlestack.data_sources.source module¶
-
class
needlestack.data_sources.source.DataSource[source]¶ Bases:
objectBase class for data source implementations. Defines interfaces for populating access data.
-
static
from_proto(proto)[source]¶ Factory method to construct the correct implementation of a DataSource from a protobuf.
- Parameters
proto (
DataSource) – Protobuf defining how to access data- Return type
-
property
last_modified¶ Last time a data source was modified
- Return type
float
-
populate_from_proto(proto)[source]¶ Populate DataSource from protobuf defining the data source
- Parameters
proto (
DataSource) – Protobuf to populate fields for DataSource implementation
-
static