Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.1 #7

Merged
merged 6 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
# Autoformatter friendly markdownlint config (all formatting rules disabled)
default: true
blank_lines: false
bullet: false
html: false
indentation: false
line_length: false
no-duplicate-heading:
siblings_only: true
no-trailing-punctuation: false
spaces: false
url: false
whitespace: false
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier
23 changes: 9 additions & 14 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.21.0
version: 1.22.0
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.4.5
ref: v1.5.0
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
Expand All @@ -27,30 +27,25 @@ lint:
commands:
- name: lint
run: bandit --exit-zero -c bandit.yaml --format json --output ${tmpfile} ${target}
- name: trufflehog
commands:
- name: lint
run: trufflehog filesystem --json --fail --exclude-paths=/.gitignore ${target}
enabled:
- actionlint@1.6.27
- bandit@1.7.8
- checkov@3.2.53
- checkov@3.2.74
- git-diff-check
- markdownlint@0.39.0
- osv-scanner@1.7.0
- osv-scanner@1.7.2
- prettier@3.2.5
- ruff@0.3.5
- semgrep@1.67.0
- ruff@0.4.1
- sourcery@1.16.0
- taplo@0.8.1
- trivy@0.50.1
- trufflehog-git@3.72.0
# - trufflehog@3.71.0
- trivy@0.50.4
- trufflehog@3.74.0
- trufflehog-git@3.74.0
- yamllint@1.35.1
disabled:
- trufflehog
- black
- isort
- semgrep
actions:
enabled:
- commitizen
Expand Down
25 changes: 13 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Contributing to Diffbot Knowledge Graph Client
# Contributing to Diffbot Knowledge Graph Client

First off, thanks for taking the time to contribute!

The following is a set of guidelines for contributing to `diffbot-kg`, which is hosted on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

### How Can I Contribute?
## How Can I Contribute?

#### Reporting Bugs
### Reporting Bugs

This section guides you through submitting a bug report for `diffbot-kg`. Following these guidelines helps the maintainer and the community understand your report, reproduce the behavior, and find related reports.

Expand All @@ -17,25 +17,26 @@ This section guides you through submitting a bug report for `diffbot-kg`. Follow
- **Explain which behavior you expected to see instead and why.**
- **Include screenshots and/or animated GIFs** which help demonstrate the steps or point out the part of Indeed Job Scraper which the suggestion is related to.

#### Pull Requests
### Pull Requests

Please follow these steps to have your contribution considered by the maintainer:

- After you submit your pull request, verify that all status checks are passing.
- While the maintainer reviews your PR, you can also ask for specific people to review your changes.
- Once your pull request is created, it will be reviewed by the maintainer of the project. You may be asked to make changes to your pull request. There's always a chance your pull request won't be accepted.

#### Python Styleguide
### Python Styleguide

- All Python must adhere to [PEP 8](https://www.python.org/dev/peps/pep-0008/).
- Use type annotations according to [PEP 484](https://www.python.org/dev/peps/pep-0484/) and [PEP 526](https://www.python.org/dev/peps/pep-0526/).
- Format your python code with [Black](https://github.com/ambv/black).
- Lint your python code with [Ruff](https://github.com/jendrikseipp/ruff).
brendancsmith marked this conversation as resolved.
Show resolved Hide resolved
- All Python must adhere to [PEP 8][PEP8].
- Use type annotations according to [PEP 484][PEP484] and [PEP 526][PEP526].
- Format and lint your python code with [Ruff](https://github.com/jendrikseipp/ruff).
- Include docstrings and comments where appropriate.
- Write tests for new features and bug fixes.

To automatically format and lint your code on commit, run `pre-commit install` in the root of the repository.

### Attribution
## Attribution

This Contributing guide is adapted from the [Contributing to Atom](https://github.com/atom/atom/blob/master/CONTRIBUTING.md) guide.

[PEP8]: https://www.python.org/dev/peps/pep-0008/
[PEP484]: https://www.python.org/dev/peps/pep-0484/
[PEP526]: https://www.python.org/dev/peps/pep-0526/
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
Diffbot Knowledge Graph Client
=============

![](https://www.diffbot.com/assets/img/diffbot-logo-darkbg.svg)
# Diffbot Knowledge Graph Client

![Diffbot Logo](https://www.diffbot.com/assets/img/diffbot-logo-darkbg.svg)

[![CodeFactor](https://www.codefactor.io/repository/github/brendancsmith/diffbot-kg/badge)](https://www.codefactor.io/repository/github/brendancsmith/diffbot-kg)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/brendancsmith/diffbot-kg/python-package.yml)
![PyPI - Version](https://img.shields.io/pypi/v/diffbot-kg)
![GitHub License](https://img.shields.io/github/license/brendancsmith/diffbot-kg)


Description
-----------
## Description

Python client for the Diffbot Knowledge Graph API.

Installation
------------
## Installation

```sh
pip install diffbot-kg
```

Usage
-----
## Usage

```python
from diffbot_kg import DiffbotSearchClient, DiffbotEnhanceClient
Expand All @@ -38,12 +32,10 @@ search_results = search_client.search({query='type:Organization name:Diffbot'})
enhanced_entity = enhance_client.enhance({query='type:Organization name:Diffbot'})
```

Contributing
------------
## Contributing

Contributions to this project are welcome. - see the CONTRIBUTING.md file for details.

License
-------
## License

This project is licensed under the MIT License - see the LICENSE file for details.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "diffbot-kg"
version = "0.2.0"
version = "0.2.1"
description = "Python client for the Diffbot Knowledge Graph API."
authors = ["Brendan C. Smith"]
license = "MIT"
Expand Down
4 changes: 4 additions & 0 deletions src/diffbot_kg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-

from diffbot_kg.clients.enhance import DiffbotEnhanceClient # noqa: F401
from diffbot_kg.clients.search import DiffbotSearchClient # noqa: F401
Empty file.
3 changes: 2 additions & 1 deletion src/diffbot_kg/clients/base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import Any

from diffbot_kg.clients.session import BaseDiffbotResponse, DiffbotSession
from yarl import URL

brendancsmith marked this conversation as resolved.
Show resolved Hide resolved
from diffbot_kg.clients.session import BaseDiffbotResponse, DiffbotSession


class BaseDiffbotKGClient:
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/clients/test_enhance_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import pytest
from aiohttp import ClientResponseError
from diffbot_kg.clients.enhance import DiffbotEnhanceClient

from diffbot_kg.clients.enhance import DiffbotEnhanceClient
from tests.functional.conftest import (
ORG2_ENTITY_ID,
ORG2_NAME,
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/clients/test_search_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from diffbot_kg.clients.search import DiffbotSearchClient

from diffbot_kg.clients.search import DiffbotSearchClient
from tests.functional.conftest import ORG_ENTITY_ID, ORG_NAME, Secret


Expand Down
1 change: 1 addition & 0 deletions tests/unit/clients/test_enhance_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from diffbot_kg.clients.enhance import DiffbotEnhanceClient
from diffbot_kg.clients.session import DiffbotSession
from diffbot_kg.models.response import DiffbotEntitiesResponse
Expand Down
1 change: 1 addition & 0 deletions tests/unit/clients/test_search_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from diffbot_kg.clients.search import DiffbotSearchClient
from diffbot_kg.clients.session import DiffbotSession
from diffbot_kg.models.response import DiffbotEntitiesResponse
Expand Down
Loading