revnext 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- revnext-0.1.2/PKG-INFO +126 -0
- revnext-0.1.2/README.md +108 -0
- {revnext-0.1.0 → revnext-0.1.2}/pyproject.toml +31 -27
- {revnext-0.1.0 → revnext-0.1.2}/revnext/__init__.py +16 -18
- {revnext-0.1.0 → revnext-0.1.2}/revnext/common.py +196 -196
- {revnext-0.1.0 → revnext-0.1.2}/revnext/config.py +61 -61
- {revnext-0.1.0 → revnext-0.1.2}/revnext/parts_by_bin_report.py +250 -250
- {revnext-0.1.0 → revnext-0.1.2}/revnext/parts_price_list_report.py +254 -254
- revnext-0.1.2/revnext.egg-info/PKG-INFO +126 -0
- {revnext-0.1.0 → revnext-0.1.2}/revnext.egg-info/SOURCES.txt +0 -1
- {revnext-0.1.0 → revnext-0.1.2}/setup.cfg +4 -4
- revnext-0.1.0/PKG-INFO +0 -24
- revnext-0.1.0/README.md +0 -8
- revnext-0.1.0/revnext/download_all_reports.py +0 -49
- revnext-0.1.0/revnext.egg-info/PKG-INFO +0 -24
- {revnext-0.1.0 → revnext-0.1.2}/revnext.egg-info/dependency_links.txt +0 -0
- {revnext-0.1.0 → revnext-0.1.2}/revnext.egg-info/requires.txt +0 -0
- {revnext-0.1.0 → revnext-0.1.2}/revnext.egg-info/top_level.txt +0 -0
revnext-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: revnext
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Revolution Next (*.revolutionnext.com.au) report downloads via REST API
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/Luen/RevNext-TUNE/
|
|
7
|
+
Project-URL: Repository, https://github.com/Luen/RevNext-TUNE/
|
|
8
|
+
Keywords: revnext,revolution-next,reports,api
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: requests
|
|
18
|
+
|
|
19
|
+
# revnext
|
|
20
|
+
|
|
21
|
+
Download Revolution Next (*.revolutionnext.com.au) reports (Parts Price List, Parts by Bin Location) via REST API using cookies/session.
|
|
22
|
+
|
|
23
|
+
Install: `pip install revnext`
|
|
24
|
+
Or from repo root: `pip install -e ./packages/revnext`
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
You need a cookies file (Chrome export for your RevNext domain). Then call the download functions with your instance URL and download location.
|
|
29
|
+
|
|
30
|
+
### Download one report with a specific file path
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
from revnext import download_parts_by_bin_report, download_parts_price_list_report
|
|
35
|
+
|
|
36
|
+
base_url = "https://yoursite.revolutionnext.com.au"
|
|
37
|
+
cookies_path = Path("revnext-cookies.json")
|
|
38
|
+
|
|
39
|
+
# Parts by Bin Location
|
|
40
|
+
path1 = download_parts_by_bin_report(
|
|
41
|
+
base_url=base_url,
|
|
42
|
+
output_path=Path("C:/Reports/parts_by_bin.csv"),
|
|
43
|
+
cookies_path=cookies_path,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# Parts Price List
|
|
47
|
+
path2 = download_parts_price_list_report(
|
|
48
|
+
base_url=base_url,
|
|
49
|
+
output_path=Path("C:/Reports/parts_price_list.csv"),
|
|
50
|
+
cookies_path=cookies_path,
|
|
51
|
+
)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Example: download both reports (implement in your project)
|
|
55
|
+
|
|
56
|
+
Copy this into your project to run both reports in sequence:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from pathlib import Path
|
|
60
|
+
from typing import Optional
|
|
61
|
+
|
|
62
|
+
from revnext import download_parts_by_bin_report, download_parts_price_list_report
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def download_all_reports(
|
|
66
|
+
cookies_path: Optional[Path | str] = None,
|
|
67
|
+
output_dir: Optional[Path | str] = None,
|
|
68
|
+
base_url: Optional[str] = None,
|
|
69
|
+
) -> list[Path]:
|
|
70
|
+
"""Run both reports and save CSVs. Returns the list of paths where files were saved."""
|
|
71
|
+
output_dir = Path(output_dir) if output_dir is not None else Path.cwd()
|
|
72
|
+
path1 = download_parts_by_bin_report(
|
|
73
|
+
cookies_path=cookies_path,
|
|
74
|
+
output_path=output_dir / "Parts_By_Bin_Location.csv",
|
|
75
|
+
base_url=base_url,
|
|
76
|
+
)
|
|
77
|
+
path2 = download_parts_price_list_report(
|
|
78
|
+
cookies_path=cookies_path,
|
|
79
|
+
output_path=output_dir / "Parts_Price_List.csv",
|
|
80
|
+
base_url=base_url,
|
|
81
|
+
)
|
|
82
|
+
return [path1, path2]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Example: download both reports in parallel (implement in your project)
|
|
86
|
+
|
|
87
|
+
Copy this into your project to run both reports concurrently (Promise.all-style):
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
91
|
+
from pathlib import Path
|
|
92
|
+
from typing import Optional
|
|
93
|
+
|
|
94
|
+
from revnext import download_parts_by_bin_report, download_parts_price_list_report
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def download_all_reports_parallel(
|
|
98
|
+
cookies_path: Optional[Path | str] = None,
|
|
99
|
+
output_dir: Optional[Path | str] = None,
|
|
100
|
+
base_url: Optional[str] = None,
|
|
101
|
+
) -> list[Path]:
|
|
102
|
+
"""Run both reports in parallel. Returns the list of paths where files were saved."""
|
|
103
|
+
output_dir = Path(output_dir) if output_dir is not None else Path.cwd()
|
|
104
|
+
path1 = output_dir / "Parts_By_Bin_Location.csv"
|
|
105
|
+
path2 = output_dir / "Parts_Price_List.csv"
|
|
106
|
+
with ThreadPoolExecutor(max_workers=2) as executor:
|
|
107
|
+
f1 = executor.submit(
|
|
108
|
+
download_parts_by_bin_report,
|
|
109
|
+
cookies_path=cookies_path,
|
|
110
|
+
output_path=path1,
|
|
111
|
+
base_url=base_url,
|
|
112
|
+
)
|
|
113
|
+
f2 = executor.submit(
|
|
114
|
+
download_parts_price_list_report,
|
|
115
|
+
cookies_path=cookies_path,
|
|
116
|
+
output_path=path2,
|
|
117
|
+
base_url=base_url,
|
|
118
|
+
)
|
|
119
|
+
return [f1.result(), f2.result()]
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Using environment variables
|
|
123
|
+
|
|
124
|
+
Set `REVOLUTIONNEXT_URL` and optionally `REVOLUTIONNEXT_COOKIES_PATH`; then you can omit `base_url` and `cookies_path` in code.
|
|
125
|
+
|
|
126
|
+
See the [main repo README](../README.md) for full configuration options.
|
revnext-0.1.2/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# revnext
|
|
2
|
+
|
|
3
|
+
Download Revolution Next (*.revolutionnext.com.au) reports (Parts Price List, Parts by Bin Location) via REST API using cookies/session.
|
|
4
|
+
|
|
5
|
+
Install: `pip install revnext`
|
|
6
|
+
Or from repo root: `pip install -e ./packages/revnext`
|
|
7
|
+
|
|
8
|
+
## Quick start
|
|
9
|
+
|
|
10
|
+
You need a cookies file (Chrome export for your RevNext domain). Then call the download functions with your instance URL and download location.
|
|
11
|
+
|
|
12
|
+
### Download one report with a specific file path
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from revnext import download_parts_by_bin_report, download_parts_price_list_report
|
|
17
|
+
|
|
18
|
+
base_url = "https://yoursite.revolutionnext.com.au"
|
|
19
|
+
cookies_path = Path("revnext-cookies.json")
|
|
20
|
+
|
|
21
|
+
# Parts by Bin Location
|
|
22
|
+
path1 = download_parts_by_bin_report(
|
|
23
|
+
base_url=base_url,
|
|
24
|
+
output_path=Path("C:/Reports/parts_by_bin.csv"),
|
|
25
|
+
cookies_path=cookies_path,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
# Parts Price List
|
|
29
|
+
path2 = download_parts_price_list_report(
|
|
30
|
+
base_url=base_url,
|
|
31
|
+
output_path=Path("C:/Reports/parts_price_list.csv"),
|
|
32
|
+
cookies_path=cookies_path,
|
|
33
|
+
)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Example: download both reports (implement in your project)
|
|
37
|
+
|
|
38
|
+
Copy this into your project to run both reports in sequence:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from pathlib import Path
|
|
42
|
+
from typing import Optional
|
|
43
|
+
|
|
44
|
+
from revnext import download_parts_by_bin_report, download_parts_price_list_report
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def download_all_reports(
|
|
48
|
+
cookies_path: Optional[Path | str] = None,
|
|
49
|
+
output_dir: Optional[Path | str] = None,
|
|
50
|
+
base_url: Optional[str] = None,
|
|
51
|
+
) -> list[Path]:
|
|
52
|
+
"""Run both reports and save CSVs. Returns the list of paths where files were saved."""
|
|
53
|
+
output_dir = Path(output_dir) if output_dir is not None else Path.cwd()
|
|
54
|
+
path1 = download_parts_by_bin_report(
|
|
55
|
+
cookies_path=cookies_path,
|
|
56
|
+
output_path=output_dir / "Parts_By_Bin_Location.csv",
|
|
57
|
+
base_url=base_url,
|
|
58
|
+
)
|
|
59
|
+
path2 = download_parts_price_list_report(
|
|
60
|
+
cookies_path=cookies_path,
|
|
61
|
+
output_path=output_dir / "Parts_Price_List.csv",
|
|
62
|
+
base_url=base_url,
|
|
63
|
+
)
|
|
64
|
+
return [path1, path2]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Example: download both reports in parallel (implement in your project)
|
|
68
|
+
|
|
69
|
+
Copy this into your project to run both reports concurrently (Promise.all-style):
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
73
|
+
from pathlib import Path
|
|
74
|
+
from typing import Optional
|
|
75
|
+
|
|
76
|
+
from revnext import download_parts_by_bin_report, download_parts_price_list_report
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def download_all_reports_parallel(
|
|
80
|
+
cookies_path: Optional[Path | str] = None,
|
|
81
|
+
output_dir: Optional[Path | str] = None,
|
|
82
|
+
base_url: Optional[str] = None,
|
|
83
|
+
) -> list[Path]:
|
|
84
|
+
"""Run both reports in parallel. Returns the list of paths where files were saved."""
|
|
85
|
+
output_dir = Path(output_dir) if output_dir is not None else Path.cwd()
|
|
86
|
+
path1 = output_dir / "Parts_By_Bin_Location.csv"
|
|
87
|
+
path2 = output_dir / "Parts_Price_List.csv"
|
|
88
|
+
with ThreadPoolExecutor(max_workers=2) as executor:
|
|
89
|
+
f1 = executor.submit(
|
|
90
|
+
download_parts_by_bin_report,
|
|
91
|
+
cookies_path=cookies_path,
|
|
92
|
+
output_path=path1,
|
|
93
|
+
base_url=base_url,
|
|
94
|
+
)
|
|
95
|
+
f2 = executor.submit(
|
|
96
|
+
download_parts_price_list_report,
|
|
97
|
+
cookies_path=cookies_path,
|
|
98
|
+
output_path=path2,
|
|
99
|
+
base_url=base_url,
|
|
100
|
+
)
|
|
101
|
+
return [f1.result(), f2.result()]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Using environment variables
|
|
105
|
+
|
|
106
|
+
Set `REVOLUTIONNEXT_URL` and optionally `REVOLUTIONNEXT_COOKIES_PATH`; then you can omit `base_url` and `cookies_path` in code.
|
|
107
|
+
|
|
108
|
+
See the [main repo README](../README.md) for full configuration options.
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "revnext"
|
|
7
|
-
version = "0.1.
|
|
8
|
-
description = "Revolution Next (*.revolutionnext.com.au) report downloads via REST API"
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
license = "MIT"
|
|
11
|
-
requires-python = ">=3.10"
|
|
12
|
-
keywords = ["revnext", "revolution-next", "reports", "api"]
|
|
13
|
-
classifiers = [
|
|
14
|
-
"Development Status :: 3 - Alpha",
|
|
15
|
-
"Intended Audience :: Developers",
|
|
16
|
-
"Programming Language :: Python :: 3",
|
|
17
|
-
"Programming Language :: Python :: 3.10",
|
|
18
|
-
"Programming Language :: Python :: 3.11",
|
|
19
|
-
"Programming Language :: Python :: 3.12",
|
|
20
|
-
]
|
|
21
|
-
dependencies = [
|
|
22
|
-
"requests",
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
[
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "revnext"
|
|
7
|
+
version = "0.1.2"
|
|
8
|
+
description = "Revolution Next (*.revolutionnext.com.au) report downloads via REST API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
keywords = ["revnext", "revolution-next", "reports", "api"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"requests",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/Luen/RevNext-TUNE/"
|
|
27
|
+
Repository = "https://github.com/Luen/RevNext-TUNE/"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["."]
|
|
31
|
+
include = ["revnext*"]
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Revolution Next (*.revolutionnext.com.au) report downloads via REST API.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from revnext.config import RevNextConfig, get_revnext_base_url_from_env
|
|
6
|
-
from revnext.parts_by_bin_report import download_parts_by_bin_report
|
|
7
|
-
from revnext.parts_price_list_report import download_parts_price_list_report
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
__version__ = "0.1.0"
|
|
1
|
+
"""
|
|
2
|
+
Revolution Next (*.revolutionnext.com.au) report downloads via REST API.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from revnext.config import RevNextConfig, get_revnext_base_url_from_env
|
|
6
|
+
from revnext.parts_by_bin_report import download_parts_by_bin_report
|
|
7
|
+
from revnext.parts_price_list_report import download_parts_price_list_report
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"RevNextConfig",
|
|
11
|
+
"get_revnext_base_url_from_env",
|
|
12
|
+
"download_parts_by_bin_report",
|
|
13
|
+
"download_parts_price_list_report",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
__version__ = "0.1.0"
|