npyodbc 5.3.0.0__cp314-cp314t-musllinux_1_2_aarch64.whl
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.
- npyodbc-5.3.0.0.dist-info/LICENSE +31 -0
- npyodbc-5.3.0.0.dist-info/METADATA +189 -0
- npyodbc-5.3.0.0.dist-info/RECORD +9 -0
- npyodbc-5.3.0.0.dist-info/WHEEL +5 -0
- npyodbc.cpython-314t-aarch64-linux-musl.so +0 -0
- npyodbc.libs/libgcc_s-2d945d6c.so.1 +0 -0
- npyodbc.libs/libicudata-3b40cc52.so.76.1 +0 -0
- npyodbc.libs/libicuuc-130fd364.so.76.1 +0 -0
- npyodbc.libs/libstdc++-85f2cd6d.so.6.0.33 +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, npyodbc development team
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are
|
|
8
|
+
met:
|
|
9
|
+
|
|
10
|
+
1. Redistributions of source code must retain the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
14
|
+
notice, this list of conditions and the following disclaimer in the
|
|
15
|
+
documentation and/or other materials provided with the distribution.
|
|
16
|
+
|
|
17
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
18
|
+
contributors may be used to endorse or promote products derived from
|
|
19
|
+
this software without specific prior written permission.
|
|
20
|
+
|
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
25
|
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
26
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
27
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
28
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
29
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
30
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: npyodbc
|
|
3
|
+
Version: 5.3.0.0
|
|
4
|
+
Summary: pyodbc extended to use NumPy
|
|
5
|
+
Author-Email: Quansight <connect@quansight.com>
|
|
6
|
+
License: BSD 3-Clause License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024, npyodbc development team
|
|
9
|
+
All rights reserved.
|
|
10
|
+
|
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
|
12
|
+
modification, are permitted provided that the following conditions are
|
|
13
|
+
met:
|
|
14
|
+
|
|
15
|
+
1. Redistributions of source code must retain the above copyright
|
|
16
|
+
notice, this list of conditions and the following disclaimer.
|
|
17
|
+
|
|
18
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
19
|
+
notice, this list of conditions and the following disclaimer in the
|
|
20
|
+
documentation and/or other materials provided with the distribution.
|
|
21
|
+
|
|
22
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
23
|
+
contributors may be used to endorse or promote products derived from
|
|
24
|
+
this software without specific prior written permission.
|
|
25
|
+
|
|
26
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
27
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
29
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
30
|
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
31
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
32
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
33
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
34
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
35
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
36
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
37
|
+
|
|
38
|
+
Project-URL: Source, https://github.com/Quansight/npyodbc
|
|
39
|
+
Requires-Python: >=3.9
|
|
40
|
+
Requires-Dist: numpy>=1.26.2
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
43
|
+
Requires-Dist: meson-python; extra == "dev"
|
|
44
|
+
Provides-Extra: test
|
|
45
|
+
Requires-Dist: pytest; extra == "test"
|
|
46
|
+
Requires-Dist: hypothesis; extra == "test"
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
|
|
49
|
+
# `npyodbc`
|
|
50
|
+
|
|
51
|
+
A python interface to Open Database Connectivity (ODBC) drivers built on top of
|
|
52
|
+
[`pyodbc`](https://github.com/mkleehammer/pyodbc) that incorporates native
|
|
53
|
+
support for `numpy`.
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
- Native support for `numpy` arrays
|
|
58
|
+
- Compatible with many ODBC drivers
|
|
59
|
+
- Can be used anywhere `pyodbc` is used
|
|
60
|
+
|
|
61
|
+
## Requirements
|
|
62
|
+
|
|
63
|
+
You'll need a database and an ODBC driver to use `npyodbc`. There are many
|
|
64
|
+
different options:
|
|
65
|
+
|
|
66
|
+
* Google BigQuery
|
|
67
|
+
* Hive from Ubuntu/Debian
|
|
68
|
+
* Microsoft Access
|
|
69
|
+
* Microsoft Excel
|
|
70
|
+
* Microsoft SQL Server
|
|
71
|
+
* MySQL
|
|
72
|
+
* Netezza
|
|
73
|
+
* Oracle
|
|
74
|
+
* PostgreSQL
|
|
75
|
+
* SQLite
|
|
76
|
+
* Teradata
|
|
77
|
+
* Vertica
|
|
78
|
+
|
|
79
|
+
Install the appropriate ODBC driver for the database you want to connect to
|
|
80
|
+
before continuing.
|
|
81
|
+
|
|
82
|
+
## Installation
|
|
83
|
+
|
|
84
|
+
You can install `npyodbc` via pip:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
pip install npyodbc
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Development installation
|
|
91
|
+
|
|
92
|
+
If you've cloned this repository and want to work on it locally,
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
pip install -e .
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Development installation using conda
|
|
99
|
+
|
|
100
|
+
If you're using `conda`, use the included `environment.yaml` to install
|
|
101
|
+
requirements:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
conda env create --file environment.yaml
|
|
105
|
+
conda activate npyodbc-dev
|
|
106
|
+
pip install -e .
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Usage
|
|
110
|
+
|
|
111
|
+
Let's set up a containerized database as an example (you'll need `docker` before
|
|
112
|
+
we begin):
|
|
113
|
+
|
|
114
|
+
1. Create a `docker-compose.yml` containing the following:
|
|
115
|
+
|
|
116
|
+
```docker-compose
|
|
117
|
+
services:
|
|
118
|
+
postgres:
|
|
119
|
+
image: postgres:11
|
|
120
|
+
environment:
|
|
121
|
+
- POSTGRES_DB=postgres_db
|
|
122
|
+
- POSTGRES_USER=postgres_user
|
|
123
|
+
- POSTGRES_PASSWORD=postgres_pwd
|
|
124
|
+
- POSTGRES_HOST_AUTH_METHOD=trust
|
|
125
|
+
|
|
126
|
+
ports:
|
|
127
|
+
- "5432:5432"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
2. Start the container: `docker compose up --build`
|
|
131
|
+
3. Configure your ODBC driver by setting `/etc/odbc.ini`:
|
|
132
|
+
|
|
133
|
+
```ini
|
|
134
|
+
[PostgreSQL Unicode]
|
|
135
|
+
Description = PostgreSQL connection to database
|
|
136
|
+
Driver = PostgreSQL Unicode
|
|
137
|
+
Servername = localhost
|
|
138
|
+
Port = 5432
|
|
139
|
+
Database = postgres_db
|
|
140
|
+
Username = postgres_user
|
|
141
|
+
Password = postgres_pwd
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
We also need to configure `/etc/odbcinst.ini`:
|
|
145
|
+
|
|
146
|
+
```ini
|
|
147
|
+
[PostgreSQL Unicode]
|
|
148
|
+
Description = PostgreSQL ODBC driver (Unicode)
|
|
149
|
+
Driver = /usr/lib/psqlodbcw.so
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Now your system is ready to connect.
|
|
153
|
+
|
|
154
|
+
3. Create a database to connect to:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Set your environment to match the settings in the container
|
|
158
|
+
export PGHOST=localhost
|
|
159
|
+
export PGPORT=5432
|
|
160
|
+
export PGDATABASE=postgres_db
|
|
161
|
+
export PGUSER=postgres_user
|
|
162
|
+
export PGPASSWORD=postgres_pwd
|
|
163
|
+
|
|
164
|
+
# Create a new database
|
|
165
|
+
psql -c "CREATE DATABASE test WITH encoding='UTF8' LC_COLLATE='en_US.utf8' LC_CTYPE='en_US.utf8'"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
4. Connect with `npyodbc`:
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
import npyodbc
|
|
172
|
+
|
|
173
|
+
# Set the connection string to match the settings in your `odbc.ini` and `odbcinst.ini`
|
|
174
|
+
connection = npyodbc.connect(
|
|
175
|
+
"DRIVER={PostgreSQL Unicode};SERVER=localhost;PORT=5432;UID=postgres_user;PWD=postgres_pwd;DATABASE=test"
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
cursor = connection.cursor()
|
|
179
|
+
|
|
180
|
+
# Create a table and insert some values
|
|
181
|
+
cursor.execute('create table t1(col text)')
|
|
182
|
+
cursor.execute('insert into t1 values (?)', 'a test string')
|
|
183
|
+
|
|
184
|
+
# Retrieve entries from the table as Python objects
|
|
185
|
+
rows = cursor.execute('select * from t1').fetchall()
|
|
186
|
+
|
|
187
|
+
# Returns [('a test string',)]
|
|
188
|
+
print(rows)
|
|
189
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
npyodbc.cpython-314t-aarch64-linux-musl.so,sha256=7dlyMj4tOf64IbpKL_tTRU9thLHWonohPOHDgSh4J_Q,332505
|
|
2
|
+
npyodbc.libs/libgcc_s-2d945d6c.so.1,sha256=dn-5kQf6XkEWhBOx7tnXMZHJQSbDdSYmPhrx8fiYeI8,201673
|
|
3
|
+
npyodbc.libs/libicudata-3b40cc52.so.76.1,sha256=kQ8uk8VWWqZy8jJ5Tj_-kUQDSf3RGY9nRwO0aPPjZdw,131265
|
|
4
|
+
npyodbc.libs/libicuuc-130fd364.so.76.1,sha256=cyerdaVD7tLdXYtCGU-o5cZmSxq9cpTr-UbjAzQwb14,2335249
|
|
5
|
+
npyodbc.libs/libstdc++-85f2cd6d.so.6.0.33,sha256=VjT6H3rGbIUp02akWf5sJoz8LifUZ4OFZJYGOR_KyeI,3650097
|
|
6
|
+
npyodbc-5.3.0.0.dist-info/LICENSE,sha256=MxAXX7iK2WT4vUmmkD8WiWBPSWAT-HoVJzQv7Gpkivg,1517
|
|
7
|
+
npyodbc-5.3.0.0.dist-info/METADATA,sha256=mdvMRrsYa3_pph0AUhc6M6tToqsGeLJ_akj237YgF7U,5372
|
|
8
|
+
npyodbc-5.3.0.0.dist-info/WHEEL,sha256=JqNYspyPtaNpJafV3qtORYILU4AFz84WtzhgDPqYPdg,100
|
|
9
|
+
npyodbc-5.3.0.0.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|