Skip to content

Commit 2ac61c4

Browse files
author
github-actions
committed
[BUILD]: fa946c89954ca862a47b628b0da0f2e4a83db7dc
1 parent 5cc7a14 commit 2ac61c4

File tree

6 files changed

+16
-59
lines changed

6 files changed

+16
-59
lines changed

README.md

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
# kucoin-python
2-
Python SDK (sync and async) for Kucoin with Rest and WS capabilities.
3-
4-
You can check Kucoin's docs here: [Docs](https://ccxt.com)
5-
6-
7-
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/kucoin)
8-
9-
*This package derives from CCXT and allows you to call pretty much every endpoint by either using the unified CCXT API or calling the endpoints directly*
10-
11-
## Installation
12-
13-
```
14-
pip install kucoin-api
15-
```
16-
17-
## Usage
18-
19-
### Async
20-
21-
```Python
22-
from kucoin-api import KucoinAsync
23-
24-
async def main():
25-
instance = KucoinAsync({})
26-
order = await instance.create_order(__EXAMPLE_SYMBOL__, "limit", "buy", 1, 100000)
27-
```
28-
29-
### Sync
30-
31-
```Python
32-
from kucoin-api import KucoinSync
33-
34-
def main():
35-
instance = KucoinSync({})
36-
order = instance.create_order(__EXAMPLE_SYMBOL__, "limit", "buy", 1, 100000)
37-
```
38-
39-
### Websockets
40-
41-
```Python
42-
from kucoin-api import KucoinWs
43-
44-
async def main():
45-
instance = KucoinWs({})
46-
while True:
47-
orders = await instance.watch_orders(__EXAMPLE_SYMBOL__)
48-
```
1+
# central repo for single exchanges
492

3+
this is dev.repo, not meant to be used by end users.

build/build.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'fs'
22
import path from 'path'
33

4-
import { argvs, exchangeArgv, execSync, cp, capitalize, regexAll } from './utils';
4+
import { argvs, sanitizePackageName, exchangeArgv, execSync, cp, capitalize, regexAll } from './utils';
55

66
import { fileURLToPath } from 'url';
77
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -156,6 +156,8 @@ class build {
156156
let value = exchangeConfig[key] || defaultValue; // at first, read from config, if not, use default
157157
newText = newText.replace(new RegExp(`${key}`, 'g'), value);
158158
}
159+
const sanitized = sanitizePackageName (exchangeConfig['__PYTHON_PACKAGE_NAME__']);
160+
newText = newText.replace(new RegExp(`__PYTHON_PACKAGE_KEY__`, 'g'), sanitized);
159161
return newText;
160162
}
161163

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"build": "tsx build.ts",
9-
"pypi-publish": "tsx pypi.ts"
9+
"pypi-publish": "tsx pypi-publish.ts"
1010
},
1111
"author": "",
1212
"license": "ISC",

build/pypi.ts renamed to build/pypi-publish.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs'
22
import path from 'path'
33
import * as semver from 'semver';
44

5-
import { argvs, mkdir, jsonFromFile, exchangeArgv, execSync, cp, capitalize, regexAll } from './utils';
5+
import { argvs, sanitizePackageName, mkdir, jsonFromFile, exchangeArgv, execSync, cp, capitalize, regexAll } from './utils';
66

77
import { fileURLToPath } from 'url';
88
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -29,7 +29,7 @@ class pypi {
2929
mkdir (this.tempPyDir + '/tests/'); // just empty folder
3030
// copy python folder to temp dir
3131
const pypiPackageName = this.exchangeConfigs[exchange].__PYTHON_PACKAGE_NAME__;
32-
const pypiPackageNameSanitized = this.sanitizeFolderName (pypiPackageName);
32+
const pypiPackageNameSanitized = sanitizePackageName (pypiPackageName);
3333
const pkgDir = this.tempPyDir + '/src/' + pypiPackageNameSanitized;
3434
mkdir (pkgDir);
3535
cp (this.rootDir + `/${this.exchange}`, pkgDir);
@@ -41,10 +41,6 @@ class pypi {
4141
this.pythonPackageBuild ();
4242
}
4343

44-
sanitizeFolderName (name:string) {
45-
return name.replace(/-/g, '_');
46-
}
47-
4844
pyprojectTolmContent(pypiPackageNameSanitized:string, newVersion: string) {
4945
const content = '' +
5046
`[build-system]\n` +

build/templates/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pip install __PYTHON_PACKAGE_NAME__
1919
### Async
2020

2121
```Python
22-
from __PYTHON_PACKAGE_NAME__ import __ExchangeName__Async
22+
from __PYTHON_PACKAGE_KEY__ import __ExchangeName__Async
2323

2424
async def main():
2525
instance = __ExchangeName__Async({})
@@ -29,7 +29,7 @@ async def main():
2929
### Sync
3030

3131
```Python
32-
from __PYTHON_PACKAGE_NAME__ import __ExchangeName__Sync
32+
from __PYTHON_PACKAGE_KEY__ import __ExchangeName__Sync
3333

3434
def main():
3535
instance = __ExchangeName__Sync({})
@@ -39,7 +39,7 @@ def main():
3939
### Websockets
4040

4141
```Python
42-
from __PYTHON_PACKAGE_NAME__ import __ExchangeName__Ws
42+
from __PYTHON_PACKAGE_KEY__ import __ExchangeName__Ws
4343

4444
async def main():
4545
instance = __ExchangeName__Ws({})

build/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ function regexAll (text: string, array: any[]) {
4646
return text;
4747
}
4848

49+
function sanitizePackageName (name:string) {
50+
return name.replace(/-/g, '_');
51+
}
52+
4953

5054

5155
function jsonFromFile (path: string) {
@@ -71,6 +75,7 @@ export {
7175
cp,
7276
mkdir,
7377
capitalize,
78+
sanitizePackageName,
7479
regexAll,
7580
exec,
7681
execSync,

0 commit comments

Comments
 (0)