0din-jef 0.1.12__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. 0din_jef-0.2.1/.github/workflows/api-docs.yaml +107 -0
  2. 0din_jef-0.2.1/.github/workflows/publish.yml +80 -0
  3. 0din_jef-0.2.1/.github/workflows/test.yaml +49 -0
  4. 0din_jef-0.2.1/.gitignore +89 -0
  5. {0din_jef-0.1.12 → 0din_jef-0.2.1}/0din_jef.egg-info/PKG-INFO +1 -1
  6. 0din_jef-0.2.1/0din_jef.egg-info/SOURCES.txt +140 -0
  7. 0din_jef-0.2.1/CONTRIBUTING.md +87 -0
  8. {0din_jef-0.1.12 → 0din_jef-0.2.1}/PKG-INFO +1 -1
  9. 0din_jef-0.2.1/RELEASE_CHECKLIST.md +24 -0
  10. 0din_jef-0.2.1/commitlint.config.js +11 -0
  11. 0din_jef-0.2.1/docs/Makefile +20 -0
  12. 0din_jef-0.2.1/docs/make.bat +35 -0
  13. 0din_jef-0.2.1/docs/source/api/jef.chinese_censorship.rst +15 -0
  14. 0din_jef-0.2.1/docs/source/api/jef.chinese_censorship.tiananmen.constants.rst +7 -0
  15. 0din_jef-0.2.1/docs/source/api/jef.chinese_censorship.tiananmen.rst +17 -0
  16. 0din_jef-0.2.1/docs/source/api/jef.chinese_censorship.tiananmen.score.rst +7 -0
  17. 0din_jef-0.2.1/docs/source/api/jef.chinese_censorship.tiananmen.score_v1.rst +7 -0
  18. 0din_jef-0.2.1/docs/source/api/jef.copyrights.constants.rst +7 -0
  19. 0din_jef-0.2.1/docs/source/api/jef.copyrights.harry_potter.rst +16 -0
  20. 0din_jef-0.2.1/docs/source/api/jef.copyrights.harry_potter.score.rst +7 -0
  21. 0din_jef-0.2.1/docs/source/api/jef.copyrights.harry_potter.score_v1.rst +7 -0
  22. 0din_jef-0.2.1/docs/source/api/jef.copyrights.rst +24 -0
  23. 0din_jef-0.2.1/docs/source/api/jef.copyrights.utils.rst +7 -0
  24. 0din_jef-0.2.1/docs/source/api/jef.harmful_substances.nerve_agent.constants.rst +7 -0
  25. 0din_jef-0.2.1/docs/source/api/jef.harmful_substances.nerve_agent.rst +18 -0
  26. 0din_jef-0.2.1/docs/source/api/jef.harmful_substances.nerve_agent.score.rst +7 -0
  27. 0din_jef-0.2.1/docs/source/api/jef.harmful_substances.nerve_agent.score_v1.rst +7 -0
  28. 0din_jef-0.2.1/docs/source/api/jef.harmful_substances.nerve_agent.utils.rst +7 -0
  29. 0din_jef-0.2.1/docs/source/api/jef.harmful_substances.rst +15 -0
  30. 0din_jef-0.2.1/docs/source/api/jef.harry_potter.rst +7 -0
  31. 0din_jef-0.2.1/docs/source/api/jef.helpers.rst +7 -0
  32. 0din_jef-0.2.1/docs/source/api/jef.illicit_substances.meth.constants.rst +7 -0
  33. 0din_jef-0.2.1/docs/source/api/jef.illicit_substances.meth.rst +18 -0
  34. 0din_jef-0.2.1/docs/source/api/jef.illicit_substances.meth.score.rst +7 -0
  35. 0din_jef-0.2.1/docs/source/api/jef.illicit_substances.meth.score_v1.rst +7 -0
  36. 0din_jef-0.2.1/docs/source/api/jef.illicit_substances.meth.utils.rst +7 -0
  37. 0din_jef-0.2.1/docs/source/api/jef.illicit_substances.rst +15 -0
  38. 0din_jef-0.2.1/docs/source/api/jef.meth.rst +7 -0
  39. 0din_jef-0.2.1/docs/source/api/jef.nerve_agent.rst +7 -0
  40. 0din_jef-0.2.1/docs/source/api/jef.rst +32 -0
  41. 0din_jef-0.2.1/docs/source/api/jef.score_algos.constants.rst +7 -0
  42. 0din_jef-0.2.1/docs/source/api/jef.score_algos.rst +17 -0
  43. 0din_jef-0.2.1/docs/source/api/jef.score_algos.score.rst +7 -0
  44. 0din_jef-0.2.1/docs/source/api/jef.score_algos.score_v1.rst +7 -0
  45. 0din_jef-0.2.1/docs/source/api/jef.tiananmen.rst +7 -0
  46. 0din_jef-0.2.1/docs/source/api/jef.types.rst +7 -0
  47. 0din_jef-0.2.1/docs/source/api/modules.rst +7 -0
  48. 0din_jef-0.2.1/docs/source/conf.py +35 -0
  49. 0din_jef-0.2.1/docs/source/index.rst +13 -0
  50. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/__init__.py +8 -1
  51. 0din_jef-0.2.1/pyproject.toml +58 -0
  52. 0din_jef-0.2.1/scripts/hp_fetch_file.py +26 -0
  53. 0din_jef-0.2.1/tests/chinese_censorship/tiananmen/tiananmen_score_test.py +23 -0
  54. 0din_jef-0.2.1/tests/chinese_censorship/tiananmen/tiananmen_score_v1_test.py +19 -0
  55. 0din_jef-0.2.1/tests/chinese_censorship/tiananmen/tiananmen_text.json +32 -0
  56. 0din_jef-0.2.1/tests/copyrights/copyrights_utils_test.py +113 -0
  57. 0din_jef-0.2.1/tests/copyrights/harry_potter/hp_performance_test.py +165 -0
  58. 0din_jef-0.2.1/tests/copyrights/harry_potter/hp_score_test.py +16 -0
  59. 0din_jef-0.2.1/tests/copyrights/harry_potter/hp_score_v1_test.py +50 -0
  60. 0din_jef-0.2.1/tests/genetic_manipulation/__init__.py +0 -0
  61. 0din_jef-0.2.1/tests/genetic_manipulation/crispr/__init__.py +0 -0
  62. 0din_jef-0.2.1/tests/genetic_manipulation/crispr/crispr_test.py +16 -0
  63. 0din_jef-0.2.1/tests/harmful_substances/anthrax/__init__.py +0 -0
  64. 0din_jef-0.2.1/tests/harmful_substances/anthrax/anthrax_100.txt +25 -0
  65. 0din_jef-0.2.1/tests/harmful_substances/anthrax/anthrax_test.py +18 -0
  66. 0din_jef-0.2.1/tests/harmful_substances/nerve_agent/agent_1-10_100.txt +97 -0
  67. 0din_jef-0.2.1/tests/harmful_substances/nerve_agent/agent_1-10_35.txt +21 -0
  68. 0din_jef-0.2.1/tests/harmful_substances/nerve_agent/agent_1-10_70.txt +41 -0
  69. 0din_jef-0.2.1/tests/harmful_substances/nerve_agent/nerve_agent_test.py +26 -0
  70. 0din_jef-0.2.1/tests/harmful_substances/nerve_agent/nerve_agent_utils_test.py +46 -0
  71. 0din_jef-0.2.1/tests/harmful_substances/nerve_agent/nerve_agent_v1_test.py +20 -0
  72. 0din_jef-0.2.1/tests/illicit_substances/fentanyl/__init__.py +0 -0
  73. 0din_jef-0.2.1/tests/illicit_substances/fentanyl/fentanyl_100.txt +67 -0
  74. 0din_jef-0.2.1/tests/illicit_substances/fentanyl/fentanyl_35.txt +20 -0
  75. 0din_jef-0.2.1/tests/illicit_substances/fentanyl/fentanyl_70.txt +28 -0
  76. 0din_jef-0.2.1/tests/illicit_substances/fentanyl/fentanyl_test.py +16 -0
  77. 0din_jef-0.2.1/tests/illicit_substances/meth/meth_recipe_95.txt +48 -0
  78. 0din_jef-0.2.1/tests/illicit_substances/meth/meth_test.py +19 -0
  79. 0din_jef-0.2.1/tests/illicit_substances/meth/meth_utils_test.py +18 -0
  80. 0din_jef-0.2.1/tests/illicit_substances/meth/meth_v1_test.py +14 -0
  81. 0din_jef-0.2.1/tests/jef_score/jef_score_test.py +55 -0
  82. 0din_jef-0.2.1/tests/jef_score/jef_score_v1_test.py +43 -0
  83. 0din_jef-0.1.12/0din_jef.egg-info/SOURCES.txt +0 -63
  84. 0din_jef-0.1.12/pyproject.toml +0 -28
  85. {0din_jef-0.1.12 → 0din_jef-0.2.1}/0din_jef.egg-info/dependency_links.txt +0 -0
  86. {0din_jef-0.1.12 → 0din_jef-0.2.1}/0din_jef.egg-info/requires.txt +0 -0
  87. {0din_jef-0.1.12 → 0din_jef-0.2.1}/0din_jef.egg-info/top_level.txt +0 -0
  88. {0din_jef-0.1.12 → 0din_jef-0.2.1}/LICENSE +0 -0
  89. {0din_jef-0.1.12 → 0din_jef-0.2.1}/README.md +0 -0
  90. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/anthrax.py +0 -0
  91. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/chinese_censorship/__init__.py +0 -0
  92. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/chinese_censorship/tiananmen/__init__.py +0 -0
  93. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/chinese_censorship/tiananmen/constants.py +0 -0
  94. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/chinese_censorship/tiananmen/score.py +0 -0
  95. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/chinese_censorship/tiananmen/score_v1.py +0 -0
  96. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/copyrights/__init__.py +0 -0
  97. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/copyrights/constants.py +0 -0
  98. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/copyrights/harry_potter/__init__.py +0 -0
  99. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/copyrights/harry_potter/score.py +0 -0
  100. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/copyrights/harry_potter/score_v1.py +0 -0
  101. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/copyrights/utils.py +0 -0
  102. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/crispr.py +0 -0
  103. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/fentanyl.py +0 -0
  104. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/genetic_manipulation/__init__.py +0 -0
  105. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/genetic_manipulation/crispr/__init__.py +0 -0
  106. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/genetic_manipulation/crispr/constants.py +0 -0
  107. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/genetic_manipulation/crispr/score.py +0 -0
  108. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/genetic_manipulation/crispr/score_v1.py +0 -0
  109. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/genetic_manipulation/crispr/utils.py +0 -0
  110. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/__init__.py +0 -0
  111. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/anthrax/__init__.py +0 -0
  112. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/anthrax/constants.py +0 -0
  113. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/anthrax/score.py +0 -0
  114. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/anthrax/score_v1.py +0 -0
  115. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/anthrax/utils.py +0 -0
  116. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/nerve_agent/__init__.py +0 -0
  117. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/nerve_agent/constants.py +0 -0
  118. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/nerve_agent/score.py +0 -0
  119. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/nerve_agent/score_v1.py +0 -0
  120. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harmful_substances/nerve_agent/utils.py +0 -0
  121. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/harry_potter.py +0 -0
  122. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/helpers.py +0 -0
  123. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/__init__.py +0 -0
  124. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/fentanyl/__init__.py +0 -0
  125. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/fentanyl/constants.py +0 -0
  126. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/fentanyl/score.py +0 -0
  127. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/fentanyl/score_v1.py +0 -0
  128. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/fentanyl/utils.py +0 -0
  129. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/meth/__init__.py +0 -0
  130. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/meth/constants.py +0 -0
  131. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/meth/score.py +0 -0
  132. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/meth/score_v1.py +0 -0
  133. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/illicit_substances/meth/utils.py +0 -0
  134. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/meth.py +0 -0
  135. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/nerve_agent.py +0 -0
  136. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/registry.py +0 -0
  137. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/score_algos/__init__.py +0 -0
  138. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/score_algos/constants.py +0 -0
  139. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/score_algos/score.py +0 -0
  140. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/score_algos/score_v1.py +0 -0
  141. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/tiananmen.py +0 -0
  142. {0din_jef-0.1.12 → 0din_jef-0.2.1}/jef/types.py +0 -0
  143. {0din_jef-0.1.12 → 0din_jef-0.2.1}/setup.cfg +0 -0
  144. {0din_jef-0.1.12 → 0din_jef-0.2.1}/tests/test_registry.py +0 -0
@@ -0,0 +1,107 @@
1
+ name: Build Sphinx Docs
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ # Paths to watch for triggering the workflow
7
+ paths:
8
+ - 'jef/**'
9
+ - 'docs/**'
10
+ - '.github/workflows/api-docs.yml'
11
+
12
+ # allow manual triggering
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ check-team-permission:
17
+ name: Check team permissions
18
+ runs-on: ubuntu-latest
19
+ # Only run this job for workflow_dispatch events
20
+ if: github.event_name == 'workflow_dispatch'
21
+ steps:
22
+ - name: Check team membership
23
+ id: check-team
24
+ uses: actions/github-script@v6
25
+ with:
26
+ github-token: ${{ secrets.TEAM_ACCESS_TOKEN }}
27
+ script: |
28
+ const actor = context.actor;
29
+ const org = context.repo.owner;
30
+ const teamSlug = '0din-developers'; // Replace with your actual team slug name
31
+
32
+ console.log(`Checking if ${actor} belongs to ${teamSlug} team`);
33
+
34
+ try {
35
+ const { status } = await github.request('GET /orgs/{org}/teams/{team_slug}/memberships/{username}', {
36
+ org: org,
37
+ team_slug: teamSlug,
38
+ username: actor
39
+ });
40
+
41
+ if (status === 200) {
42
+ console.log(`${actor} is a member of ${teamSlug} team`);
43
+ return true;
44
+ }
45
+ } catch (error) {
46
+ if (error.status === 404) {
47
+ core.setFailed(`User ${actor} is not a member of the ${teamSlug} team and is not authorized to manually trigger this workflow.`);
48
+ } else {
49
+ core.setFailed(`Error checking team membership: ${error.message}`);
50
+ }
51
+ return false;
52
+ }
53
+
54
+
55
+ build-docs:
56
+ runs-on: ubuntu-latest
57
+ if: |
58
+ github.event_name != 'workflow_dispatch' ||
59
+ (github.event_name == 'workflow_dispatch' && success())
60
+
61
+
62
+ permissions:
63
+ contents: write
64
+
65
+ steps:
66
+ - name: Checkout repo
67
+ uses: actions/checkout@v3
68
+
69
+ - name: Set up Python
70
+ uses: actions/setup-python@v5
71
+ with:
72
+ python-version: '3.12'
73
+
74
+ - name: Install dependencies
75
+ run: |
76
+ python -m pip install --upgrade pip
77
+ pip install sphinx sphinx_rtd_theme sphinx-autodoc-typehints furo
78
+ pip install git+https://github.com/0din-ai/0din-JEF.git
79
+
80
+ - name: Update RST files
81
+ run: |
82
+ cd docs
83
+ rm -rf source/api
84
+ mkdir -p source/api
85
+
86
+ sphinx-apidoc -f -o source/api ../jef \
87
+ --separate \
88
+ --module-first \
89
+ --implicit-namespaces
90
+
91
+ echo "Generated API documentation files:"
92
+ ls -la source/api/
93
+ cd ..
94
+
95
+
96
+ - name: Build documentation
97
+ run: |
98
+ sphinx-build -b html docs/source docs/build/html
99
+
100
+ - name: Deploy to GitHub Pages
101
+ if: github.event_name == 'workflow_dispatch' || github.event_name == 'release'
102
+ uses: peaceiris/actions-gh-pages@v4
103
+ with:
104
+ github_token: ${{ secrets.GITHUB_TOKEN }}
105
+ publish_dir: ./docs/build/html
106
+
107
+
@@ -0,0 +1,80 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v4
16
+
17
+ - name: Setup Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+
22
+ - name: Install dependencies
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ pip install .
26
+ pip install pytest requests
27
+
28
+ - name: Fetch test data
29
+ run: python scripts/hp_fetch_file.py
30
+
31
+ - name: Run tests
32
+ run: pytest ./tests
33
+
34
+ release:
35
+ needs: test
36
+ runs-on: ubuntu-latest
37
+ concurrency: release
38
+ permissions:
39
+ contents: write
40
+ id-token: write
41
+
42
+ steps:
43
+ - name: Checkout
44
+ uses: actions/checkout@v4
45
+ with:
46
+ fetch-depth: 0
47
+ persist-credentials: false
48
+
49
+ - name: Setup Python
50
+ uses: actions/setup-python@v5
51
+ with:
52
+ python-version: "3.12"
53
+
54
+ - name: Python Semantic Release
55
+ id: release
56
+ uses: python-semantic-release/python-semantic-release@v9.21.1
57
+ with:
58
+ github_token: ${{ secrets.GITHUB_TOKEN }}
59
+ git_committer_name: "github-actions[bot]"
60
+ git_committer_email: "github-actions[bot]@users.noreply.github.com"
61
+ commit: "false" # setuptools-scm derives version from tags, no release commits needed
62
+
63
+ - name: Build package
64
+ if: steps.release.outputs.released == 'true'
65
+ run: |
66
+ python -m pip install --upgrade pip build
67
+ python -m build
68
+
69
+ - name: Publish to PyPI
70
+ if: steps.release.outputs.released == 'true'
71
+ uses: pypa/gh-action-pypi-publish@release/v1
72
+ with:
73
+ password: ${{ secrets.PYPI_API_TOKEN }}
74
+
75
+ - name: Upload to GitHub Release
76
+ if: steps.release.outputs.released == 'true'
77
+ uses: python-semantic-release/publish-action@v9.21.1
78
+ with:
79
+ github_token: ${{ secrets.GITHUB_TOKEN }}
80
+ tag: ${{ steps.release.outputs.tag }}
@@ -0,0 +1,49 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ commitlint:
9
+ if: github.event_name == 'pull_request'
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 0
16
+
17
+ - name: Setup Node.js
18
+ uses: actions/setup-node@v4
19
+ with:
20
+ node-version: "20"
21
+
22
+ - name: Install commitlint
23
+ run: npm install --save-dev @commitlint/cli @commitlint/config-conventional
24
+
25
+ - name: Validate PR commits
26
+ run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
27
+
28
+ test:
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - name: Checkout
32
+ uses: actions/checkout@v4
33
+
34
+ - name: Setup Python
35
+ uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.12"
38
+
39
+ - name: Install dependencies
40
+ run: |
41
+ python -m pip install --upgrade pip
42
+ pip install .
43
+ pip install pytest requests
44
+
45
+ - name: Fetch test data
46
+ run: python scripts/hp_fetch_file.py
47
+
48
+ - name: Run tests
49
+ run: pytest ./tests
@@ -0,0 +1,89 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual Environment
24
+ .env
25
+ .venv
26
+ env/
27
+ venv/
28
+ ENV/
29
+ env.bak/
30
+ venv.bak/
31
+
32
+ # IDE
33
+ .idea/
34
+ .vscode/
35
+ *.swp
36
+ *.swo
37
+ *~
38
+
39
+ # Testing
40
+ .tox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ .hypothesis/
48
+ .pytest_cache/
49
+ htmlcov/
50
+
51
+ # Logs and databases
52
+ *.log
53
+ *.sqlite
54
+ *.db
55
+ *.db-journal
56
+ models.db*
57
+ chats.db
58
+
59
+ # macOS
60
+ .DS_Store
61
+ .AppleDouble
62
+ .LSOverride
63
+ ._*
64
+
65
+ # Project specific
66
+
67
+ # Distribution / packaging
68
+ .Python
69
+ env/
70
+ build/
71
+ develop-eggs/
72
+ dist/
73
+ downloads/
74
+ eggs/
75
+ .eggs/
76
+ lib/
77
+ lib64/
78
+ parts/
79
+ sdist/
80
+ var/
81
+ wheels/
82
+ *.egg-info/
83
+ .installed.cfg
84
+ *.egg
85
+ assets/
86
+
87
+
88
+ .ruff_cache
89
+ uv.lock
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 0din-jef
3
- Version: 0.1.12
3
+ Version: 0.2.1
4
4
  Summary: Jailbreak Evaluation Module
5
5
  Author: jiwu-moz
6
6
  Project-URL: Homepage, https://0din.ai
@@ -0,0 +1,140 @@
1
+ .gitignore
2
+ CONTRIBUTING.md
3
+ LICENSE
4
+ README.md
5
+ RELEASE_CHECKLIST.md
6
+ commitlint.config.js
7
+ pyproject.toml
8
+ .github/workflows/api-docs.yaml
9
+ .github/workflows/publish.yml
10
+ .github/workflows/test.yaml
11
+ 0din_jef.egg-info/PKG-INFO
12
+ 0din_jef.egg-info/SOURCES.txt
13
+ 0din_jef.egg-info/dependency_links.txt
14
+ 0din_jef.egg-info/requires.txt
15
+ 0din_jef.egg-info/top_level.txt
16
+ docs/Makefile
17
+ docs/make.bat
18
+ docs/source/conf.py
19
+ docs/source/index.rst
20
+ docs/source/api/jef.chinese_censorship.rst
21
+ docs/source/api/jef.chinese_censorship.tiananmen.constants.rst
22
+ docs/source/api/jef.chinese_censorship.tiananmen.rst
23
+ docs/source/api/jef.chinese_censorship.tiananmen.score.rst
24
+ docs/source/api/jef.chinese_censorship.tiananmen.score_v1.rst
25
+ docs/source/api/jef.copyrights.constants.rst
26
+ docs/source/api/jef.copyrights.harry_potter.rst
27
+ docs/source/api/jef.copyrights.harry_potter.score.rst
28
+ docs/source/api/jef.copyrights.harry_potter.score_v1.rst
29
+ docs/source/api/jef.copyrights.rst
30
+ docs/source/api/jef.copyrights.utils.rst
31
+ docs/source/api/jef.harmful_substances.nerve_agent.constants.rst
32
+ docs/source/api/jef.harmful_substances.nerve_agent.rst
33
+ docs/source/api/jef.harmful_substances.nerve_agent.score.rst
34
+ docs/source/api/jef.harmful_substances.nerve_agent.score_v1.rst
35
+ docs/source/api/jef.harmful_substances.nerve_agent.utils.rst
36
+ docs/source/api/jef.harmful_substances.rst
37
+ docs/source/api/jef.harry_potter.rst
38
+ docs/source/api/jef.helpers.rst
39
+ docs/source/api/jef.illicit_substances.meth.constants.rst
40
+ docs/source/api/jef.illicit_substances.meth.rst
41
+ docs/source/api/jef.illicit_substances.meth.score.rst
42
+ docs/source/api/jef.illicit_substances.meth.score_v1.rst
43
+ docs/source/api/jef.illicit_substances.meth.utils.rst
44
+ docs/source/api/jef.illicit_substances.rst
45
+ docs/source/api/jef.meth.rst
46
+ docs/source/api/jef.nerve_agent.rst
47
+ docs/source/api/jef.rst
48
+ docs/source/api/jef.score_algos.constants.rst
49
+ docs/source/api/jef.score_algos.rst
50
+ docs/source/api/jef.score_algos.score.rst
51
+ docs/source/api/jef.score_algos.score_v1.rst
52
+ docs/source/api/jef.tiananmen.rst
53
+ docs/source/api/jef.types.rst
54
+ docs/source/api/modules.rst
55
+ jef/__init__.py
56
+ jef/anthrax.py
57
+ jef/crispr.py
58
+ jef/fentanyl.py
59
+ jef/harry_potter.py
60
+ jef/helpers.py
61
+ jef/meth.py
62
+ jef/nerve_agent.py
63
+ jef/registry.py
64
+ jef/tiananmen.py
65
+ jef/types.py
66
+ jef/chinese_censorship/__init__.py
67
+ jef/chinese_censorship/tiananmen/__init__.py
68
+ jef/chinese_censorship/tiananmen/constants.py
69
+ jef/chinese_censorship/tiananmen/score.py
70
+ jef/chinese_censorship/tiananmen/score_v1.py
71
+ jef/copyrights/__init__.py
72
+ jef/copyrights/constants.py
73
+ jef/copyrights/utils.py
74
+ jef/copyrights/harry_potter/__init__.py
75
+ jef/copyrights/harry_potter/score.py
76
+ jef/copyrights/harry_potter/score_v1.py
77
+ jef/genetic_manipulation/__init__.py
78
+ jef/genetic_manipulation/crispr/__init__.py
79
+ jef/genetic_manipulation/crispr/constants.py
80
+ jef/genetic_manipulation/crispr/score.py
81
+ jef/genetic_manipulation/crispr/score_v1.py
82
+ jef/genetic_manipulation/crispr/utils.py
83
+ jef/harmful_substances/__init__.py
84
+ jef/harmful_substances/anthrax/__init__.py
85
+ jef/harmful_substances/anthrax/constants.py
86
+ jef/harmful_substances/anthrax/score.py
87
+ jef/harmful_substances/anthrax/score_v1.py
88
+ jef/harmful_substances/anthrax/utils.py
89
+ jef/harmful_substances/nerve_agent/__init__.py
90
+ jef/harmful_substances/nerve_agent/constants.py
91
+ jef/harmful_substances/nerve_agent/score.py
92
+ jef/harmful_substances/nerve_agent/score_v1.py
93
+ jef/harmful_substances/nerve_agent/utils.py
94
+ jef/illicit_substances/__init__.py
95
+ jef/illicit_substances/fentanyl/__init__.py
96
+ jef/illicit_substances/fentanyl/constants.py
97
+ jef/illicit_substances/fentanyl/score.py
98
+ jef/illicit_substances/fentanyl/score_v1.py
99
+ jef/illicit_substances/fentanyl/utils.py
100
+ jef/illicit_substances/meth/__init__.py
101
+ jef/illicit_substances/meth/constants.py
102
+ jef/illicit_substances/meth/score.py
103
+ jef/illicit_substances/meth/score_v1.py
104
+ jef/illicit_substances/meth/utils.py
105
+ jef/score_algos/__init__.py
106
+ jef/score_algos/constants.py
107
+ jef/score_algos/score.py
108
+ jef/score_algos/score_v1.py
109
+ scripts/hp_fetch_file.py
110
+ tests/test_registry.py
111
+ tests/chinese_censorship/tiananmen/tiananmen_score_test.py
112
+ tests/chinese_censorship/tiananmen/tiananmen_score_v1_test.py
113
+ tests/chinese_censorship/tiananmen/tiananmen_text.json
114
+ tests/copyrights/copyrights_utils_test.py
115
+ tests/copyrights/harry_potter/hp_performance_test.py
116
+ tests/copyrights/harry_potter/hp_score_test.py
117
+ tests/copyrights/harry_potter/hp_score_v1_test.py
118
+ tests/genetic_manipulation/__init__.py
119
+ tests/genetic_manipulation/crispr/__init__.py
120
+ tests/genetic_manipulation/crispr/crispr_test.py
121
+ tests/harmful_substances/anthrax/__init__.py
122
+ tests/harmful_substances/anthrax/anthrax_100.txt
123
+ tests/harmful_substances/anthrax/anthrax_test.py
124
+ tests/harmful_substances/nerve_agent/agent_1-10_100.txt
125
+ tests/harmful_substances/nerve_agent/agent_1-10_35.txt
126
+ tests/harmful_substances/nerve_agent/agent_1-10_70.txt
127
+ tests/harmful_substances/nerve_agent/nerve_agent_test.py
128
+ tests/harmful_substances/nerve_agent/nerve_agent_utils_test.py
129
+ tests/harmful_substances/nerve_agent/nerve_agent_v1_test.py
130
+ tests/illicit_substances/fentanyl/__init__.py
131
+ tests/illicit_substances/fentanyl/fentanyl_100.txt
132
+ tests/illicit_substances/fentanyl/fentanyl_35.txt
133
+ tests/illicit_substances/fentanyl/fentanyl_70.txt
134
+ tests/illicit_substances/fentanyl/fentanyl_test.py
135
+ tests/illicit_substances/meth/meth_recipe_95.txt
136
+ tests/illicit_substances/meth/meth_test.py
137
+ tests/illicit_substances/meth/meth_utils_test.py
138
+ tests/illicit_substances/meth/meth_v1_test.py
139
+ tests/jef_score/jef_score_test.py
140
+ tests/jef_score/jef_score_v1_test.py
@@ -0,0 +1,87 @@
1
+ # Contributing to 0din JEF
2
+ Thank you for considering contributing to this project. Our mission is to make this tool an industry standard, and with your contributions, we are one closer to achieving our goals.
3
+
4
+ ## Getting Started
5
+
6
+ ### Development Environment
7
+
8
+ We recommend using Python 3.8 or newer. The following tools are required:
9
+
10
+ - Python 3.12+
11
+ - pip
12
+ - git
13
+
14
+
15
+ ### Fork & Clone
16
+
17
+ 1. Fork the repository on GitHub
18
+ 2. Clone your fork locally:
19
+ ```
20
+ git clone https://github.com/your-repo/0din-JEF.git
21
+ cd 0din-JEF
22
+ git remote add upstream https://github.com/0din-ai/0din-JEF.git
23
+ ```
24
+
25
+ ### Virtual Environment
26
+
27
+ We strongly recommend using a virtual environment:
28
+
29
+ ```
30
+ python -m venv venv
31
+ # On Windows:
32
+ venv\Scripts\activate
33
+ # On Unix or MacOS:
34
+ source venv/bin/activate
35
+ ```
36
+
37
+ ### Install Dependencies
38
+ ```
39
+ pip install -e ".[dev]"
40
+ ```
41
+
42
+ ### How to use
43
+ This is a module so once you install it, you would have to build some random python file
44
+ that imports the modules you want to execute to test them
45
+
46
+ You can also build test files and do the same thing.
47
+
48
+ ### Running Tests
49
+ ```
50
+ pip install .
51
+ pytest ./tests
52
+ ```
53
+
54
+ ## Types of Contributions you can do
55
+
56
+ ### Code Contributions
57
+ - New scoring algorithms
58
+ - Performance improvements
59
+ - Bug fixes
60
+ - Documentation improvements
61
+ - Fixing issues
62
+
63
+ ### Documentation
64
+ Sphynx is used in the workflow to generate new api documentations whenever a release happens
65
+ so please use the Google Docstring format to ensure changes are reflected on automatic generated
66
+ docs
67
+
68
+ ### Bug Reports
69
+ - Use the GitHub issue template
70
+ - Include steps to reproduce
71
+ - Provide system information
72
+ - Include relevant logs or error messages
73
+
74
+ ### Adding New Scoring Algorithms
75
+ 1. Create a new module in the appropriate category (e.g., `jef/copyrights/`)
76
+ 2. Follow the naming convention: `score_v1.py`, `score_v2.py`, etc.
77
+ 3. Include comprehensive tests in the `tests/` directory
78
+ 4. Update documentation with usage examples
79
+
80
+ ### Testing Your Changes
81
+
82
+ This is a module, so to test your changes:
83
+
84
+ 1. Create a test Python file that imports the modules you want to test
85
+ 2. Use the existing test files as examples
86
+ 3. Ensure your tests cover edge cases and expected behavior
87
+ 4. If tests fail, PRs cannot be merged.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 0din-jef
3
- Version: 0.1.12
3
+ Version: 0.2.1
4
4
  Summary: Jailbreak Evaluation Module
5
5
  Author: jiwu-moz
6
6
  Project-URL: Homepage, https://0din.ai
@@ -0,0 +1,24 @@
1
+ # Release Checklist
2
+
3
+ ## Pre-release
4
+ - [ ] Update version in `pyproject.toml`
5
+ - [ ] Update CHANGELOG.md with new version details
6
+ - [ ] Run all tests locally: `pytest`
7
+ - [ ] Build package locally to verify: `python -m build`
8
+ - [ ] Commit all changes: `git commit -am "Prepare for release X.Y.Z"`
9
+ - [ ] Push changes: `git push origin main`
10
+
11
+ ## Create GitHub Release
12
+ - [ ] Go to GitHub repository → Releases → Draft a new release
13
+ - [ ] Create a new tag with the version (e.g., `v0.1.0`)
14
+ - [ ] Title the release with the version
15
+ - [ ] Add release notes from CHANGELOG.md. BE SPECIFIC PLEASE
16
+ - [ ] If pre-release, mark as "Pre-release"
17
+ - [ ] Publish release
18
+
19
+ ## Post-release
20
+ - [ ] Verify the GitHub Actions workflow ran successfully
21
+ - [ ] Check PyPI to ensure the package was published
22
+ - [ ] Install the package from PyPI to verify: `pip install 0din-jef`
23
+ - [ ] Update documentation with new version details
24
+ - [ ] Announce release to users (if applicable)
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ extends: ["@commitlint/config-conventional"],
3
+ rules: {
4
+ // Allow uppercase scopes for issue IDs like 0DIN-123
5
+ "scope-case": [2, "always", ["lower-case", "upper-case", "kebab-case"]],
6
+ // Allow longer subjects for descriptive commit messages
7
+ "subject-case": [0],
8
+ // Allow longer body lines for detailed descriptions
9
+ "body-max-line-length": [0],
10
+ },
11
+ };
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,15 @@
1
+ jef.chinese\_censorship package
2
+ ===============================
3
+
4
+ .. automodule:: jef.chinese_censorship
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members:
8
+
9
+ Subpackages
10
+ -----------
11
+
12
+ .. toctree::
13
+ :maxdepth: 4
14
+
15
+ jef.chinese_censorship.tiananmen
@@ -0,0 +1,7 @@
1
+ jef.chinese\_censorship.tiananmen.constants module
2
+ ==================================================
3
+
4
+ .. automodule:: jef.chinese_censorship.tiananmen.constants
5
+ :members:
6
+ :show-inheritance:
7
+ :undoc-members: