Skip to main content

Particle.One Data API

Description

This package contains a Python client code to access data and examples of how to use it.

  • p1_data_client_python
    • A Python module wrapping the Data REST API and EDGAR Data REST API into a Pandas-friendly interface
  • notebooks/p1_data_client_example.ipynb
    • An example Jupyter notebook showing how to use the Python module
  • notebooks/p1_data_api_v1_example.ipynb
    • An example Jupyter notebook showing how to connect to the Data REST API directly
  • notebooks/p1_edgar_data_client_example.ipynb
    • An example Jupyter notebook showing how to use the EDGAR Data REST API
  • test/client_examples.py
    • Minimal example of API and EDGAR clients

Prerequisites

  • Python version >= 3.7

Installation through PyPI

  • You can install the Particle.One data python client in 3 different ways:
  1. Install from PyPI:

    pip install p1_data_client_python
    
  2. Install and build from the source

  • Assuming the name of the Github repo is <GITHUB_REPO> (e.g., p1_data_client_python)
    pip install git+https://github.com/ParticleDev/<INSERT_GITHUB_REPO_NAME>.git
    
  1. Install without building the package from source:
# Check out the code.
git clone git@github.com:ParticleDev/<INSERT_GITHUB_REPO_NAME>.git
cd p1_data_client_python

# Create environment.
python3 -m venv ./venv
source venv/bin/activate
pip install -r requirements.txt
  • Test that the package is visible:

    python -c "import p1_data_client_python; print(p1_data_client_python)"
    <module 'p1_data_client_python' (namespace)>
    
    > python -c "import p1_data_client_python.version as version; print(version.VERSION)"
    
  • When installing from source, you need to add the path of this package to PYTHONPATH, e.g.:

    export PYTHONPATH=$(pwd):$(pwd)/p1_data_client_python
    

Getting a Particle.One token

  • Go to https://particle.one/ and request a free token
  • The token looks like e44e7c6b04ef3ea1cfb7a8a67db74751c177259e

Configuring through environment variables

  • To use the notebooks, unit tests, and examples you need to configure the environment with:

    export P1_API_TOKEN='your_api_token_here'
    export P1_EDGAR_API_TOKEN='your_edgar_token_here'
    
  • E.g., from test/set_env_vars.sh

    export P1_API_TOKEN='e44e7c6b04ef3ea1cfb7a8a67db74751c177259e'
    export P1_EDGAR_API_TOKEN='8c9c9458b145202c7a6b6cceaabd82023e957a46d6cf7061ed8e1c94a168f2fd'
    

Run tests (only when installing from source)

  • After configuring the environment variables, run all tests with:

    pytest -vv
    =============================================================================================== test session starts ================================================================================================
    platform linux -- Python 3.7.3, pytest-6.0.2, py-1.9.0, pluggy-0.13.1
    rootdir: /wd/saggese/src/p1_data_client_python
    plugins: openfiles-0.4.0, astropy-header-0.1.2, flaky-3.7.0, doctestplus-0.4.0, remotedata-0.3.1, arraydiff-0.3, hypothesis-5.3.0
    collected 20 items
    
    test/test_client.py ....
    test/test_client_jupyter.py .
    test/test_client_mock.py ....
    test/test_edgar_client.py ........
    test/test_edgar_client_mock.py ...
    ================================================================================================ 9 passed in 3.46s =================================================================================================
    

Notebook

  • After configuring the environment variables, run a notebook server with:

    jupyter notebook '--ip=*' --browser chrome . --port 9999
    
  • GitHub repo
    • https://github.com/ParticleDev/p1_data_client_python
  • Rest API documentation
    • https://doc.particle.one
  • Data entry point
    • https://data.particle.one

License

MIT License

Metadata

Release files for p1-data-client-python 1.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for p1-data-client-python 1.8.2
File Size Uploaded Provenance Actions
p1_data_client_python-1.8.2.tar.gz 52.1 kB Without provenance Details for p1_data_client_python-1.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for p1-data-client-python 1.8.2
File Interpreter ABI Platform Actions
p1_data_client_python-1.8.2-py3-none-any.whl Python 3 none any Details for p1_data_client_python-1.8.2-py3-none-any.whl

Total release size: 101.8 kB

Release files / p1_data_client_python-1.8.2.tar.gz

Download URL p1_data_client_python-1.8.2.tar.gz
Size 52.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a8cf7889e840c014edb025198b7b03fc5d92637c070ca314078782b152694c8a
BLAKE2b-256 checksum
How to use checksums
de1d0cd515b63e236ceb4931327c86e661ae36dda4fa7c091c1dd6154a8ad343
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.6

Release files / p1_data_client_python-1.8.2-py3-none-any.whl

Download URL p1_data_client_python-1.8.2-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f9bfc0f98b8b21a38c8a6dc2a766d3b9e6547b5c35204f6ddf465d8c851b043
BLAKE2b-256 checksum
How to use checksums
4e32821263c2b73f27fff33a944b06e3eeb7170fdb6fdde44e504c3f4e8fc69a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.6

Security for p1-data-client-python 1.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page