Skip to main content

A class of functions that can call the different SNCF API's from https://data.sncf.com/, returns data as pandas dataframe or .json() object.

Project description

SNCF Api

Build Status

DeepSource

CodeFactor

A class of methods that can call the different SNCF API's from SNCF Open Data, returns data as a Pandas dataframe or .json() object.

That Pandas dataframe has some elements clipped.

Some of the calls can be huge, as SNCF has put a lot of data up. Some calls may even max out the api interface. list line by type is an example.

Requirements

  • Pandas
  • Requests
  • Python 3.8

Installation

Use the package manager pip to install.

pip install sncf-api

Usage

Import the class.

import sncf_api as sncf

Call the class (with or without the line code).

sncf = sncf(903000)

Or

sncf = sncf()

Call methods.

db = sncf.list_construction_site()

To get a list of methods from class.

help(sncf)

Notes

Methods don't need to be called with arguments, only the class. The convert_to_pandas_db() method with used the data from the last method called and return a pandas dataframe.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

URL's

SNCF Open Data

Pandas

Pip

Make a readme

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sncf_api-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sncf_api-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file sncf_api-0.1.1.tar.gz.

File metadata

  • Download URL: sncf_api-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10

File hashes

Hashes for sncf_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e36ee1b0e62a51397196747a2b36da63e01df295ff2a50205619ed26279f2a4
MD5 136445bebdb968b19857390836c194b4
BLAKE2b-256 ae4f8f40ed355e93c996cd5407f475c9e27d6a98b7f8a937c6bfba962c731c02

See more details on using hashes here.

File details

Details for the file sncf_api-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sncf_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.2 Windows/10

File hashes

Hashes for sncf_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d2a34ce8e98e7d07f01769343ddb911b6fe6d6cd092ce6aadc89b89cb2171894
MD5 a6faa4939d44586e349c4c6c09466623
BLAKE2b-256 f683485c8f704f45ceaa1ec4a6c41e64ee2e829db9b5677259e9a3f3f0e7cad5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page