Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

matthew73210/sncf_api

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages