semvec/pypi-packages huggingface dataset:
dataf1-goktugocal 0.0.1
A Python toolkit for seamless access to live and historical Formula 1 data.
License: MIT
Requires Python: >=3.7

# easyf1
An open-sourced Formula 1 data processing library.

## USAGE

#### Import the library
```python
from easyf1 as easyf1
```

#### Get season object and its meetings + sessions
```python
season = easyf1.get_season(
    season = 2024
)

print(season) # Shows the dataframe table of sessions and their informations
print(season.meetings) # Get meeting objects
```

#### Get meeting object and its sessions
```python
meeting = easyf1.get_meeting(
    season = 2024,
    location = "Monza"
)

print(meeting) # Shows the dataframe table of sessions and their informations
print(meeting.sessions) # Get session objects
```

#### Get session object and load data
```python
session = easyf1.get_session(
    season=2024,
    location="Monza",
    session="Race"
)

session.get_topic_names() # load /Info.json
print(session.topic_names_info)
```

```json
{
  "SessionInfo": {
    "KeyFramePath": "SessionInfo.json",
    "StreamPath": "SessionInfo.jsonStream"
  },
  "ArchiveStatus": {
    "KeyFramePath": "ArchiveStatus.json",
    "StreamPath": "ArchiveStatus.jsonStream"
  },
  "Position.z": {
    "KeyFramePath": "Position.z.json",
    "StreamPath": "Position.z.jsonStream"
  },
  "CarData.z": {
    .
    .
    .
```

Load specific data by name of data
```python
data = session.get_data(
    dataName = "Position.z",
    dataType = "StreamPath",
    stream = True
)

print(type(data))
# <class 'easyf1.data_processing.data_models.BasicResult'>

print(data)
#     SessionKey     timestamp                           Utc DriverNo   Status     X      Y     Z
# 0         9590  00:00:30.209  2024-09-01T12:08:13.7879709Z        1  OnTrack     0      0     0
# 1         9590  00:00:30.209  2024-09-01T12:08:13.7879709Z        3  OnTrack     0      0     0
# 2         9590  00:00:30.209  2024-09-01T12:08:13.7879709Z        4  OnTrack     0      0     0
# 3         9590  00:00:30.209  2024-09-01T12:08:13.7879709Z       10  OnTrack     0      0     0

print(data.value)
# [
#   {'SessionKey': 9590, 'timestamp': '00:00:30.209', 'Utc': '2024-09-01T12:08:13.7879709Z', 'DriverNo': '1', 'Status': 'OnTrack', 'X': 0, 'Y': 0, 'Z': 0},
#   {'SessionKey': 9590, 'timestamp': '00:00:30.209', 'Utc': '2024-09-01T12:08:13.7879709Z', 'DriverNo': '3', 'Status': 'OnTrack', 'X': 0, 'Y': 0, 'Z': 0},
#   {'SessionKey': 9590, 'timestamp': '00:00:30.209', 'Utc': '2024-09-01T12:08:13.7879709Z', 'DriverNo': '4', 'Status': 'OnTrack', 'X': 0, 'Y': 0, 'Z': 0},
#   .
#   .
#   .
# ]
```
django-request-cache 1.5.0
A simple Django app that provides a per-request cache.
License: MIT

====================
Django Request Cache
====================

.. image:: https://badge.fury.io/py/django-request-cache.svg
    :target: https://badge.fury.io/py/django-request-cache
.. image:: https://github.com/anexia/django-request-cache/actions/workflows/test.yml/badge.svg?branch=main
    :target: https://github.com/anexia/django-request-cache/actions/workflows/test.yml
.. image:: https://codecov.io/gh/anexia/django-request-cache/branch/main/graph/badge.svg
    :target: https://codecov.io/gh/anexia/django-request-cache

Django Request Cache provides a cache for each request (within your Django Request/Response cycle).

Quick start
-----------

1. Download and install using `pip install`

.. code-block:: bash

    pip install django-request-cache


2. Add ``UserForeignKeyMiddleware`` and ``RequestCacheMiddleware`` to your ``MIDDLEWARE`` settings like this:

.. code-block:: python

    MIDDLEWARE = (
        ...
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        ...
        'django_userforeignkey.middleware.UserForeignKeyMiddleware',
        'django_request_cache.middleware.RequestCacheMiddleware',
    )


or if you are still using the an older Django version (e.g., Django 1.8) with ``MIDDLEWARE_CLASSES``:

.. code-block:: python

    MIDDLEWARE_CLASSES = (
        ...
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        ...
        'django_userforeignkey.middleware.UserForeignKeyMiddleware',
        'django_request_cache.middleware.RequestCacheMiddleware',
    )


3. Use the per-request cache as a decorator

.. code-block:: python

    from django_request_cache import cache_for_request

    @cache_for_request
    def do_some_complex_calculation(a, b, c):
        print("Calculating... please wait")
        return a * b * c


Try it out by executing do_some_complex_calculation multiple times within your request

Attribution
-----------

``RequestCache`` and ``RequestCacheMiddleware`` (see ``middleware.py``) are from a source code snippet on StackOverflow
https://stackoverflow.com/questions/3151469/per-request-cache-in-django/37015573#37015573
created by coredumperror https://stackoverflow.com/users/464318/coredumperror
Original Question was posted by https://stackoverflow.com/users/7679/chase-seibert
at https://stackoverflow.com/questions/3151469/per-request-cache-in-django
copied on 2017-Dec-20