Skip to content

Commit 1d7f509

Browse files
Refactor README.md.
1 parent ab4cde0 commit 1d7f509

File tree

2 files changed

+70
-54
lines changed

2 files changed

+70
-54
lines changed

README.md

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Open Source Python/Oracle Utility - cx_Oracle
1+
# Python cx_Oracle interface to Oracle Database
22

33
cx_Oracle is a Python extension module that enables access to Oracle Database.
44
It conforms to the [Python database API 2.0 specification][1] with a
@@ -11,61 +11,45 @@ cx_Oracle 6 has been tested with Python version 2.7, and with versions
1111
client libraries. Oracle's standard client-server version
1212
interoperability allows connection to both older and newer databases,
1313
for example Oracle 12.2 client libraries can connect to Oracle
14-
Database 11.2 or later.
14+
Database 11.2.
1515

16-
## Documentation
16+
## Getting Started
1717

18-
See the [cx_Oracle Documentation][2] and [Release Notes][14].
18+
Install Python from [python.org][4].
1919

20-
## Help
20+
Install cx_Oracle using [Quick Start cx_Oracle Installation][6].
2121

22-
Issues and questions can be raised with the cx_Oracle community on
23-
[GitHub][9] or on the [mailing list][5].
22+
Download cx_Oracle [samples][12] or create a script like the one
23+
below.
2424

25-
## Installation
25+
Locate your Oracle Database username and password, and the database
26+
connection string. The connection string is commonly of the format
27+
`hostname/servicename`, using the hostname where the database is
28+
running, and the service name of the Oracle Database instance.
2629

27-
See [cx_Oracle Installation][15] for detailed instructions.
30+
Substitute your username, password and connection string in the code.
31+
For downloaded examples, put these in [`SampleEnv.py`][13] and
32+
[`SampleEnv.sql`][10], and then follow [`sample/README`][16] to create
33+
the cx_Oracle sample schema. SQL scripts to create Oracle Database's
34+
common sample schemas can be found at
35+
[github.com/oracle/db-sample-schemas][17].
2836

29-
- The simplest way to install cx_Oracle 6 is with pip:
37+
Run the Python script, for example:
3038

3139
```
32-
python -m pip install cx_Oracle --upgrade
40+
python myscript.py
3341
```
3442

35-
If a binary wheel package is not available on [PyPI][6] for your platform, the
36-
source package will be used.
37-
38-
Note that if you download a source zip file directly from GitHub
39-
that you will also need to download an [ODPI-C][10] source zip file
40-
and extract it inside the directory called "odpi".
41-
42-
- After cx_Oracle is installed, Oracle client libraries must also be installed
43-
and configured. These can be from Oracle Instant Client, from a local Oracle
44-
Database, or from a full Oracle Client installation.
45-
46-
If you need the libraries, download and unzip the [Oracle Instant Client][4]
47-
'Basic' package for your platform and set PATH, LD_LIBRARY_PATH, or similar
48-
platform-specific library path loading environment. See
49-
the [installation notes for ODPI-C][13] for help.
50-
51-
Versions 11.2, 12.1 and 12.2 of the Oracle Client libraries on Linux,
52-
Windows and macOS are supported. Users have also reported success
53-
with other platforms.
54-
55-
If you require cx_Oracle 5.3, download a Windows installer from
56-
[PyPI][16] or use `python -m pip install cx-oracle==5.3` to
57-
install from source.
58-
59-
Very old versions of cx_Oracle can be found in the files section at
60-
[SourceForce][17].
61-
62-
## Example
43+
### Sample cx_Oracle Script
6344

6445
```python
46+
# myscript.py
47+
6548
from __future__ import print_function
6649

6750
import cx_Oracle
6851

52+
# Connect as user "hr" with password "welcome" to the "oraclepdb" service running on this computer.
6953
connection = cx_Oracle.connect("hr", "welcome", "localhost/orclpdb")
7054

7155
cursor = connection.cursor()
@@ -79,9 +63,32 @@ for fname, lname in cursor:
7963
print("Values:", fname, lname)
8064
```
8165

82-
For more examples, please see the [test suite][11] and the
83-
[samples][12]. You can also look at the scripts in [cx_OracleTools][7] and
84-
the modules in [cx_PyOracleLib][8].
66+
## Installation
67+
68+
See [cx_Oracle Installation][15].
69+
70+
## Examples
71+
72+
See the [samples][12] directory and the [test suite][11]. You can also
73+
look at the scripts in [cx_OracleTools][7] and the modules in
74+
[cx_PyOracleLib][8].
75+
76+
## Documentation
77+
78+
See the [cx_Oracle Documentation][2].
79+
80+
## Changes
81+
82+
See [What's New][18] and the [Release Notes][14].
83+
84+
## Tests
85+
86+
See the [test suite][11].
87+
88+
## Help
89+
90+
Issues and questions can be raised with the cx_Oracle community on
91+
[GitHub][9] or on the [mailing list][5].
8592

8693
## Features
8794

@@ -169,17 +176,18 @@ for more information.
169176
[1]: https://www.python.org/dev/peps/pep-0249
170177
[2]: http://cx-oracle.readthedocs.io
171178
[3]: https://github.com/oracle/python-cx_Oracle/blob/master/LICENSE.txt
172-
[4]: http://www.oracle.com/technetwork/database/features/instant-client/index.html
179+
[4]: https://www.python.org/downloads/
173180
[5]: http://lists.sourceforge.net/lists/listinfo/cx-oracle-users
174-
[6]: https://pypi.python.org/pypi/cx_Oracle
181+
[6]: http://cx-oracle.readthedocs.io/en/latest/installation.html#quick-start-cx-oracle-installation
175182
[7]: http://cx-oracletools.sourceforge.net
176183
[8]: http://cx-pyoraclelib.sourceforge.net
177184
[9]: https://github.com/oracle/python-cx_Oracle/issues
178-
[10]: https://oracle.github.io/odpi
185+
[10]: https://github.com/oracle/python-cx_Oracle/blob/master/samples/sql/SampleEnv.sql
179186
[11]: https://github.com/oracle/python-cx_Oracle/tree/master/test
180187
[12]: https://github.com/oracle/python-cx_Oracle/tree/master/samples
181-
[13]: https://oracle.github.io/odpi/doc/installation.html
188+
[13]: https://github.com/oracle/python-cx_Oracle/tree/master/samples/SampleEnv.py
182189
[14]: http://cx-oracle.readthedocs.io/en/latest/releasenotes.html
183190
[15]: http://cx-oracle.readthedocs.io/en/latest/installation.html
184-
[16]: https://pypi.python.org/pypi/cx_Oracle/5.3
185-
[17]: https://sourceforge.net/projects/cx-oracle/files/
191+
[16]: https://github.com/oracle/python-cx_Oracle/tree/master/samples/README.md
192+
[17]: https://github.com/oracle/db-sample-schemas
193+
[18]: http://cx-oracle.readthedocs.io/en/latest/whatsnew.html

samples/README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
This directory contains samples for cx_Oracle.
22

3-
The schemas and SQL objects that are referenced in the samples can be created
4-
by running the SQL script sql/SetupSamples.sql. The syntax is:
3+
The schemas and SQL objects that are referenced in the samples can be
4+
created by running the SQL script
5+
[sql/SetupSamples.sql][1]. The
6+
syntax is:
57

68
sqlplus / as sysdba @sql/SetupSamples.sql
79

810
The script will create users pythondemo and pythoneditions and will create an
911
edition called python_e1. If you wish to change the names of the users or the
10-
name of the edition you can edit the file sql/SampleEnv.sql. You will also
11-
need to edit the file SampleEnv.py or set environment variables as documented
12-
in SampleEnv.py.
12+
name of the edition you can edit the file [sql/SampleEnv.sql][2]. You will also
13+
need to edit the file [SampleEnv.py][4] or set environment variables as documented
14+
in it.
1315

1416
After running the samples, the schemas and SQL objects can be dropped by
15-
running the SQL script sql/DropSamples.sql. The syntax is
17+
running the SQL script [sql/DropSamples.sql][3]. The syntax is
1618

1719
sqlplus / as sysdba @sql/DropSamples.sql
1820

21+
22+
23+
[1]: https://github.com/oracle/python-cx_Oracle/blob/master/samples/sql/SetupSamples.sql
24+
[2]: https://github.com/oracle/python-cx_Oracle/blob/master/samples/sql/SampleEnv.sql
25+
[3]: https://github.com/oracle/python-cx_Oracle/blob/master/samples/sql/DropSamples.sql
26+
[4]: https://github.com/oracle/python-cx_Oracle/blob/master/samples/SampleEnv.py

0 commit comments

Comments
 (0)