Skip to main content

Useful library

Project description

rn3: Python tools to help manage EEA Reportnet3

This repository contains tools to ineract with Reportnet3.

Requirements

  • Windows or Linux operating system
  • Python x64 3.8 - 3.12

Installation

From PyPI:

pip install rn3

Use 1: Generate Microsoft SQL script to create data tables based on a dataset in Reportnet3

import rn3

ds = DatasetModel()
ds.from_url(
    dataset_id=20822,
    api_key="ApiKey d79237c1-8942-44b9-b6df-2ef20fca66a4",
    base_url=r"https://sandbox-api.reportnet.europa.eu",
)
sql_cmd = ds.sql_cmd(self, database_name="EnergyCommunity", schema_name="annex_XXIV")

print(sql_cmd)

output:

USE [EnergyCommunity]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [annex_XXIV].[PaMs](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Title] [nvarchar](500) NOT NULL,
	[TitleNational] [nvarchar](500) NULL,
	[IsGroup] [int] NOT NULL,
	[ListOfSinglePams] [nvarchar](500) NULL,
	[ShortDescription] [text] NOT NULL,
	[ReportNet3HistoricReleaseId] [int] NOT NULL,
CONSTRAINT [PK_PaMs] PRIMARY KEY CLUSTERED
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [annex_XXIV].[PaMs]  WITH NOCHECK ADD  CONSTRAINT [FK_PaMs_ReportNet3HistoricReleases] FOREIGN KEY([ReportNet3HistoricReleaseId])
REFERENCES [metadata].[ReportNet3HistoricReleases] ([Id])
ON DELETE CASCADE
GO
ALTER TABLE [annex_XXIV].[PaMs] CHECK CONSTRAINT [FK_PaMs_ReportNet3HistoricReleases]
GO

.
.
.

... for all tables in dataset

Contributor note

Before commit, run pre-commit hook pip install pre-commit re-commit run -a

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

rn3-0.0.10.tar.gz (137.8 kB view details)

Uploaded Source

Built Distribution

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

rn3-0.0.10-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file rn3-0.0.10.tar.gz.

File metadata

  • Download URL: rn3-0.0.10.tar.gz
  • Upload date:
  • Size: 137.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rn3-0.0.10.tar.gz
Algorithm Hash digest
SHA256 adaa20b644a6c856f50c52600beb0fe136d3d397c9cc7a8974622bd135023786
MD5 6ebdc764ee6cb1d65973802ac79bce02
BLAKE2b-256 69dee62c4bb1c7d6efad667902fa1eb94fb6ad127899c26b8d798fe7d4b2410f

See more details on using hashes here.

File details

Details for the file rn3-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: rn3-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for rn3-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 124bcee752e2521f568ffcd6035f30317d1927b9a328f2e1e3be46e9f88e9292
MD5 957ff00d3cadb9ef741777a02d7f5e56
BLAKE2b-256 4e36ac1e455a9e3e2c34e4ed03e18264201b3ceb7eadfb3c836cd5626a158e34

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