semvec/pypi-packages huggingface dataset:
dependency-detector 0.7.0
Detect dependencies necessary to build a project
License: MIT
Requires Python: >=3.8.0


![Python](https://github.com/meeshkan/dependency-detector/workflows/Python/badge.svg)
[![PyPI version](https://badge.fury.io/py/dependency-detector.svg)](https://badge.fury.io/py/dependency-detector)
[![License](https://img.shields.io/pypi/l/http-types)](LICENSE)

# dependency-detector
Tool to analyse a project for packages necessary to build it.

# Installation
```sh
pip install dependency-detector
```

# Usage
Specify a directory containing a project. This will output the commands necessary to install build dependencies on a Ubuntu 20.04 environment:

```sh
$ dependency-detector tests/python37-from-pipfile 
add-apt-repository ppa:deadsnakes/ppa; apt update; apt install python3.7

$ dependency-detector tests/java8-and-maven      
apt install openjdk-8-jdk-headless; apt install maven
```

# Development
1. Create a new virtual environment.
1. Install dependencies: `pip install --upgrade -e '.[dev]'`
1. Install [pyright](https://github.com/microsoft/pyright).
1. Run `python setup.py test` to test.
1. Run `pip install dependency-detector` to install the command-line tool

# Publishing
1. Bump the version in [setup.py](./setup.py). Commit and push.
1. Run `python setup.py test` and `python setup.py dist` to check that everything works.
1. To build and upload the package, run `python setup.py upload`. Insert PyPI credentials to upload the package to `PyPI`. The command will also run `git tag` to tag the commit as a release and push the tags to remote.
ttictoc 0.5.6
Time parts of your code easily.
License: MIT
Keywords: tictoc tic toc time timing

# ttictoc
Time execution of blocks of code.

##
Tested against python 3.6, python 3.7, and 3.8

## How to install
From pip
```
pip install ttictoc
```
or download this repo and do
```
pip install .
```

## TicToc
The easiest way to time something is with `tic` and `toc`

```python
import time
from ttictoc import tic,toc
tic()
time.sleep(1)
elapsed = toc()
print('Elapsed time:',elapsed)
```

You can execute multiple tocs in a matlab-like fashon
```
import time
from ttictoc import tic,toc
tic()
for i in range(2):
  tic()
  time.sleep(1)
  elapsed = toc()
  print('[IN LOOP] Elapsed time:',elapsed)
print('[OUT LOOP] Elapsed time:',toc())
```

## Timer Class
It works just like `tic`,`toc`.
```python
import time
from ttictoc import Timer

# Simple
t = Timer()
t.start()
time.sleep(1)
elapsed = t.stop()
print('Elapsed time:',elapsed)


# Nested
t.start()
for i in range(2):
  t.start()
  time.sleep(1)
  elapsed = t.stop()
  print('[IN LOOP] Elapsed time:',elapsed)
print('[OUT LOOP] Elapsed time:',t.stop())
```

## Context manager
You can also use it as context manager
```python
import time
from ttictoc import Timer

# Default
with Timer():
  time.sleep(1)

# With out verbose
with Timer(verbose=False) as T:
  time.sleep(1)
print('Elapsed time:',T.elapsed)

# With default verbose message
with Timer(verbose_msg=f'[User msg][{time.time()}] Elapsed time: {{}}'):
  time.sleep(1)
```

## Deactivating matlab-like nesting
You can deactivate the matlab-like nesting. In this case calling start will update the global starting time for toc. However, you can have nested tics by giving a `key` to start and stop.
```python
import time
from ttictoc import Timer,tic2,toc2

tic2()
for i in range(2):
  tic2()
  time.sleep(1)
  elapsed = toc2()
  print('[IN LOOP] Elapsed time:',elapsed)
print('[OUT LOOP] Elapsed time:',toc2())

t = Timer(matlab_like=False)
t.start()
time.sleep(1)
t.start() # Restarts the starting point
time.sleep(1)
elapsed = t.stop()
print('Elapsed time:',elapsed) # ~1 second

# Nested
t.start(key='Init')
for i in range(2):
  t.start(key=i)
  time.sleep(1)
  elapsed = t.stop(key=i)
  print('[IN LOOP] Elapsed time:',elapsed)
print('[OUT LOOP] Elapsed time:',t.stop('Init'))


print('\n[OUT LOOP][Init] Elapsed time:',t.stop('Init'))
print('[OUT LOOP][0] Elapsed time:',t.stop(0))
print('[OUT LOOP][1] Elapsed time:',t.stop(1))
```

## Specify timing method
By default, `Timer` (and `tic`,`toc`) use `timeit.default_timer`. However, the timing function can be selected as follow.
```python
import time
from ttictoc import Timer
t = Timer(func_time=time.clock)
t.start()
time.sleep(5)
elapsed = t.stop()
print('Elapsed time:',elapsed)
```
RouterOS-Prometheus-client 0.0.7
Python Prometheus client to RouterBoard devices produced by MikroTik.
License: MIT
Requires Python: >=3.6

# RouterOS Prometheus client
#### Description

Prometheus client for Mikrotik devices. Can be configured to collect metrics
from a single device or multiple devices.

To access the api, use [RouterOS-api](https://github.com/socialwifi/RouterOS-api).

To create metrics, use [Prometheus Python Client](https://github.com/prometheus/client_python).

## Install
`pip install routeros-prometheus-client`

## Usage

#### Mikrotik Config

Create a user on the device that has API and read-only access.

`/user group add name=prometheus policy=api,read,winbox`

Create the user to access the API via.

`/user add name=prometheus group=prometheus password=changeme`

#### Create config file

```
[my_router]
host = 192.168.1.1
username = login
password = password
plaintext_login = True
interface = True
wireless = False
caps_man = True
l2tp = True
gre = True

[my_second_router]
host = 192.168.1.2
username = login
password = password
plaintext_login = True
interface = True
wireless = True
caps_man = False
l2tp = False
gre = False
```
* `[section]` - String - Used for identification device
* `host` - String - Hostname or IP of device
* `username` - String - Login username - Default 'admin'
* `password` - String - Login password - Default empty string
* `port` - Integer - TCP Port for API - Default 8728 or 8729 when using SSL
* `plaintext_login` - Boolean - Try plaintext login (for RouterOS 6.43 onwards) - Default False
* `use_ssl` - Boolean - Use SSL or not? - Default False
* `ssl_verify` - Boolean - Verify the SSL certificate? - Default True
* `ssl_verify_hostname` - Boolean - Verify the SSL certificate hostname matches? - Default True
* `ssl_context` - Object - Pass in a custom SSL context object. Overrides other options. - Default None
* `interface` `wireless` `caps_man` `l2tp` `gre` - What metrics to collect

#### Start routeros-prometheus-client
`routeros-prometheus-client -c routeros-prometheus-client\config.ini -p 8000`

* `-c` `--config` path to `config.ini`
* `-p` `--port` HTTPServer port