Package: p1-data-client-python
Particle.One Data APIDescriptionPrerequisitesInstallationGetting a Particle.One tokenQuick StartData APIEDGAR Data APIRun testsUseful linksLicenseParticle.One Data APIDescriptionThis package contains a Python client code to access data and examples of how to
use it.p1_data_client_pythonA Python module wrapping the Data REST API and EDGAR Data REST API into a
Pandas-friendly interfacenotebooks/p1_data_client_example.ipynbAn example Jupyter notebook showing how to use the Python modulenotebooks/p1_data_api_v1_example.ipynbAn example Jupyter notebook showing how to connect to the Data REST API
directlynotebooks/p1_edgar_data_client_example.ipynbAn example Jupyter notebook showing how to use the EDGAR Data REST APItest/client_examples.pyMinimal example of API and EDGAR clientsPrerequisitesPython version >= 3.7Installation through PyPIYou can install the Particle.One data python client in 3 different ways:Install from PyPI:pipinstallp1_data_client_pythonInstall and build from the sourceAssuming the name of the Github repo is <GITHUB_REPO> (e.g.,p1_data_client_python)pipinstallgit+https://github.com/ParticleDev/<INSERT_GITHUB_REPO_NAME>.gitInstall without building the package from source:# Check out the code.gitclonegit@github.com:ParticleDev/<INSERT_GITHUB_REPO_NAME>.gitcdp1_data_client_python# Create environment.python3-mvenv./venvsourcevenv/bin/activate
pipinstall-rrequirements.txtTest 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 toPYTHONPATH, e.g.:exportPYTHONPATH=$(pwd):$(pwd)/p1_data_client_pythonGetting a Particle.One tokenGo tohttps://particle.one/and request a free tokenThe token looks likee44e7c6b04ef3ea1cfb7a8a67db74751c177259eConfiguring through environment variablesTo use the notebooks, unit tests, and examples you need to configure the
environment with:exportP1_API_TOKEN='your_api_token_here'exportP1_EDGAR_API_TOKEN='your_edgar_token_here'E.g., fromtest/set_env_vars.shexportP1_API_TOKEN='e44e7c6b04ef3ea1cfb7a8a67db74751c177259e'exportP1_EDGAR_API_TOKEN='8c9c9458b145202c7a6b6cceaabd82023e957a46d6cf7061ed8e1c94a168f2fd'Run tests (only when installing from source)After configuring the environment variables, run all tests with:pytest-vv===============================================================================================testsessionstarts================================================================================================platformlinux--Python3.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
collected20items

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...================================================================================================9passedin3.46s=================================================================================================NotebookAfter configuring the environment variables, run a notebook server with:jupyternotebook'--ip=*'--browserchrome.--port9999Useful linksGitHub repohttps://github.com/ParticleDev/p1_data_client_pythonRest API documentationhttps://doc.particle.oneData entry pointhttps://data.particle.oneLicenseMIT License