Skip to main content

A toolbox for daily use. This is just a toolbox to make my life easier. Maybe yours too..

Project description

Codewars.nl

Make sure to install all the dependencies needed for each individual module.

Dependencies

Required:

- `sudo apt-get install gcc`
- `sudo apt-get install libbluetooth-dev`

Install latest version (stable)

pip install codewars

Alternative versions

1. Go to "https://github.com/0x78f1935/codewars/releases" and do
2. Download the latest version, unzip it.
3. Open a virtualenv and navigate to the extracted folder.
4. Now install the wheel package:
    `python -m pip install codewars-x_x_x_whl`

Install development version (unstable)

pip install git+https://github.com/0x78f1935/codewars@master

Docker

There is also a Dockerfile and a docker-compose.yaml file which include a python build where codewars will be preinstalled. You can modify the dockerfile to your liking. The Dockerfile downloads always the unstable version by default.

Examples

Info

Refer for detailed documentation to here

In the following section you will find a brief example on how to use this code. This library is ment to grow over time so more examples to come...

Logger

Example:
```
from codewars.logger import Logger
logger = Logger(appname="test", mode="DEBUG", write=False)
logger._testLoggerClass()
logger.info("Hello World!")
```

Note

The whole module makes use of the Logger class instead of the print method.

UnitTests

Example:
```
from codewars.unittest import Test
print(Test().run())
```

BlueTooth

Example:
```
from codewars.bluetooth import Bluetooth
bt = Bluetooth()  # Initialize the class, Scans once
scan_results1 = bt.scan()  # Scan area for the default 10 seconds, this is \
# also executed when this class initializes
scan_results2 = bt.run_until_discovered()  # Scan until a device is found
print("Scan results1: {}".format(scan_results1))
print("Scan results2: {}".format(scan_results2))
```

Wifi

Example:
```
from codewars.wifi import Wifi
wifi = Wifi("enp0s31f6")
sniff_results = wifi.sniff(totalResults=10)
print(sniff_results)
info_results = wifi.info(sniff_results)
print(info_results)
wifi.sniff_forever(duration=300)
```

Surfer

Example:
```
from codewars.surf import Surfer
from asyncio import get_event_loop
surf = Surfer(loop=get_event_loop())
# GET METHODS
print(surf.get(url='http://httpbin.org/get')) # Read page
print(surf.get(url='http://httpbin.org/get', json=True)) # Read json
print(surf.get(url='http://httpbin.org/basic-auth/test/test1123', auth=('test', 'test1123'), json=True))
# POST METHODS
print(surf.post(
    url='http://httpbin.org/post',
    header={'api_key': 'special-key'},
    data={
        "id": 0x78f1935,
        "username": "codewars",
    },
    json=True
    ))
```

Scraper

Example
```
from codewars.scraper import Scraper
scraper = Scraper(debug=True)
scraper.hrefs(url = 'https://codewars.nl/space')
```

Refer for detailed documentation to here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

codewars-0.0.621-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file codewars-0.0.621-py3-none-any.whl.

File metadata

  • Download URL: codewars-0.0.621-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for codewars-0.0.621-py3-none-any.whl
Algorithm Hash digest
SHA256 eb682122d7df4ad3475fdd55f893d4e98fa20b55626ce0b5500dc73a843f1dba
MD5 45a515a40038b2c4ee7ace7b5107f26b
BLAKE2b-256 aba99757a7eeec27bb679101060fd47885d2a44082fa688174c901e6da4e6656

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page