Skip to main content

connect and parse spd files

Project description

SPD API

This file will become your README and also the index of your documentation.

Install

pip install spd_api

This is a basic interface with the EA web files to extract data

We can choose a year and get a dataframe of the available files:

extract_spd_list(2020)
NameError: name 'extract_spd_list' is not defined

More practically is to list a month and a year (due to size issues) and this will return the bus and branch data

month, year = 1 , 2022
spd_df = extract_spd_list(year)
await main_spd(spd_df.loc[f'{year}-{month}'], year)
(                INTERVAL               BRANCHNAME FROM_STATION TO_STATION  \
 0    2022-01-01 00:00:00         ABY     MXT1MXT1          ABY        ABY   
 1    2022-01-01 00:00:00           ABY     T2  T2          ABY        ABY   
 2    2022-01-01 00:00:00  ALB     ALB_HEN3      1          ALB        HEN   
 3    2022-01-01 00:00:00  ALB     ALB_HPI1      1          ALB        HPI   
 4    2022-01-01 00:00:00  ALB     ALB_SVL1      1          ALB        SVL   
 ...                  ...                      ...          ...        ...   
 1077 2022-01-31 23:30:00           WTU     T4  T4          WTU        WTU   
 1078 2022-01-31 23:30:00         WVY     MXT1MXT1          WVY        WVY   
 1079 2022-01-31 23:30:00           WVY     T1  T1          WVY        WVY   
 1080 2022-01-31 23:30:00           WWD     T1  T1          WWD        WWD   
 1081 2022-01-31 23:30:00           WWD     T2  T2          WWD        WWD   
 
         FROM_MW      TO_MW  BRANCHLOSSES  
 0      0.000000   0.000000       0.00000  
 1     -4.597000  -4.606000       0.01446  
 2    -18.837000 -18.860001       0.02267  
 3     13.488000  13.478000       0.00905  
 4     14.881000  14.872000       0.00912  
 ...         ...        ...           ...  
 1077  19.447001  19.407000       0.06421  
 1078   0.000000   0.000000       0.00000  
 1079   2.808000   2.799000       0.01193  
 1080  -0.318000  -0.318000       0.00000  
 1081  -2.753000  -2.753000       0.00000  
 
 [1612512 rows x 7 columns],
                INTERVAL ID_BUS ID_ST       LOAD  GENERATION
 0   2022-01-01 00:00:00    100   MVE   0.000000      0.0000
 1   2022-01-01 00:00:00    101   MVE   0.000000      0.0000
 2   2022-01-01 00:00:00    102   RTO   0.000000      0.0000
 3   2022-01-01 00:00:00    103   CBG  19.943001      0.0000
 4   2022-01-01 00:00:00    104   CBG   0.000000      0.0000
 ..                  ...    ...   ...        ...         ...
 930 2022-01-31 23:30:00     95   ARI   0.000000     15.3333
 931 2022-01-31 23:30:00     96   ARI   0.000000     15.3333
 932 2022-01-31 23:30:00     97   ARI   0.000000     15.3333
 933 2022-01-31 23:30:00     98   ARI   0.000000      0.0000
 934 2022-01-31 23:30:00     99   MVE   0.000000      0.0000
 
 [1392881 rows x 5 columns])

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

spd_api-0.0.8.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

spd_api-0.0.8-py3-none-any.whl (11.9 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