semvec/pypi-packages huggingface dataset:
filext 0.2.2
Python library to identify file type based on its file signature


# filext
Python library to identify file type based on its file signature

### Installation
```
pip install filext
```

### Usage

If the category of the file is not certain, you may use `whatfile` but is a little slower
```python
from filext import whatfile

file_path = "./tests/files/document.pdf"

# pass file as path str
file_type = whatfile(file_path)

with open(filepath, "rb") as file:
    # pass file as bytes
    file_type = whatfile(file.read())
```

If the category of the file is known, you may use the function for that category instead.
```python
from filext import whatdoc

file_path = "./tests/files/document.pdf"

# pass file as path str
file_type = whatdoc(file_path)

with open(filepath, "rb") as file:
    # pass file as bytes
    file_type = whatdoc(file.read())
```

### Supported File Types
#### Documents
- [x] PDF
- [x] DOC
- [x] PPT
- [x] XLS
- [x] DOCX
- [x] PPTX
- [x] XLSX

#### Images
- [x] BMP
- [x] GIF
- [x] HEIC
- [x] JPG
- [x] PNG
- [x] TIF
spiderbot 0.3.3
a spider bot (scrawler) by python, using selenium and chrome driver
Requires Python: >=3.5
Keywords: selenium,spider,chrome,bot,scrawler

# spiderbot

a spider bot, published as module [spiderbot](https://pypi.org/project/spiderbot/).

### How to use?

#### Install

```sh
pip install spiderbot
```

install chrome browser and [chromedriver](https://chromedriver.chromium.org/downloads), and put chromedrive binary into the PATH dir.

#### Config

Init the config_private.py, using config_private_sample.py as example, and update the value of `XPATHS` and `DB_NAME` arguments.

or,

When Generating an instance of SpiderBot, pass the value of `xpaths` and `db_name` arguments.

#### Run it

Init the database by pass the `init=True` to Generate an instance of SpiderBot. If successed, `spiderbot.db` was created.

```py
from spiderbot import SpiderBot

bot = SpiderBot(skip_driver=True, init=True)
```

Then add users to scrawler. You can add users always as needed.

```py
from spiderbot import SpiderBot

urls = ["https://example.com/user_a_homepage", "https://example.com/user_b_homepage"]

bot = SpiderBot()
bot.add_users(working_status=True, *urls)

```

At last, do the main job: 

```py
from spiderbot import SpiderBot

bot = SpiderBot()
bot.get_profiles()
bot.get_new_posturls()
bot.get_history_posturls(1, 9)
bot.get_posts()
bot.quit()
```

[more examples](./examples/)

### Code Format

```sh
isort .
black .
pylint spiderbot > pylint_spiderbot.log
```