-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from metaodi/server-side-pagination
Use the new server-side pagination of pyodata
- Loading branch information
Showing
23 changed files
with
6,877 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.8 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ source pyenv/bin/activate | |
|
||
pip install --upgrade pip | ||
pip install flit | ||
pre-commit install | ||
flit install -s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import logging | ||
import swissparlpy | ||
from pprint import pprint | ||
|
||
|
||
# setup logger to see debug messages from swissparlpy | ||
spp_logger = logging.getLogger("swissparlpy.client") | ||
spp_logger.setLevel(logging.DEBUG) | ||
|
||
logging.basicConfig( | ||
format="%(asctime)s %(levelname)-10s %(name)s: %(message)s", | ||
datefmt="%Y-%m-%d %H:%M:%S", | ||
) | ||
logging.captureWarnings(True) | ||
|
||
|
||
business = swissparlpy.get_data("Business", Language="DE") | ||
print(f"Count: {business.count})") | ||
print(f"Internal data: {len(business.data)}") | ||
|
||
pprint(business) | ||
pprint(business[1]) | ||
pprint(business[1001]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import swissparlpy as spp | ||
from pprint import pprint | ||
|
||
sessions = spp.get_data( | ||
table="Session" | ||
) | ||
sessions = spp.get_data(table="Session") | ||
|
||
print(f"Total rows: {len(sessions)}") | ||
for session in sessions[5:10]: | ||
pprint(session) | ||
|
||
|
||
# print any element | ||
print('') | ||
print("") | ||
pprint(sessions[587]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
[flake8] | ||
max-complexity = 10 | ||
exclude = .git,__pycache__,pyenv,.pytest_cache | ||
# the new Torvalds default for line length | ||
max-line-length = 100 | ||
# set to true to check all ignored errors | ||
disable_noqa = False | ||
|
||
# adaptions for black | ||
max-line-length = 88 | ||
extend-ignore = E203 | ||
|
||
[tool:pytest] | ||
addopts = --cov=swissparlpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.