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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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