Skip to main content

Intuitive client for the Danish Parliament API.

Project description

Folketinget

Folketinget is an intuitive Python client for the Danish Parliament API. It simplifies accessing and querying parliamentary data, making it easy to integrate into your projects (it is still in super beta mode).


Installation

Install the package via pip:

pip install folketinget

Usage

After installing, you can start using the client in your Python code. The main class to interact with is Folketinget, which provides access to various API endpoints. Currently, only the "Sag" endpoint is supported with two query methods.

1. Get Latest Updated IDs Since a Given Timestamp

To retrieve the IDs of "Sag" records updated after a specific timestamp:

import datetime
from folketinget import Folketinget

# Initialize the client
client = Folketinget()

# Define the timestamp (e.g., yesterday)
yesterday = datetime.datetime.today() - datetime.timedelta(days=1)

# Retrieve the IDs of cases updated since yesterday
updated_ids = client.sag.get_latest_updated_ids_since(timestamp=yesterday)

print("Updated IDs since yesterday:", updated_ids)

2. Get a Fixed Number of Latest Updated IDs

To retrieve a specified number of the most recently updated "Sag" records:

from folketinget import Folketinget

# Initialize the client
client = Folketinget()

# Retrieve the 10 most recent updated case IDs
latest_ids = client.sag.get_n_latest_updated_ids(n=10)

print("10 latest updated case IDs:", latest_ids)

Authors

  • Kasper Junge
  • Jonas Høgh Kyhse-Andersen

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

folketinget-0.1.1.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

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

folketinget-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: folketinget-0.1.1.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for folketinget-0.1.1.tar.gz
Algorithm Hash digest
SHA256 24ffacc1b8a4dcd62be26057198f4a09f9f2f7d80138afa86eb48fd1b81a1e4d
MD5 94317f0dc81f07998d0cbe8ee61eefc6
BLAKE2b-256 455278db5c537f4766e6f5b4e31dbf9992a49156cc6eb60daea4db9a606b17cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for folketinget-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd3c019d7cf3a92740152cf608eca39c5bffb5eb9b2a840ef2f930cda0155e14
MD5 ff378983b4cb4b792bb7fd319c445ced
BLAKE2b-256 d2ab8864d29e4db485629a2f256d21383c2367f6939b44a85eee0d7afc24d837

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