openai / openai-guardrails-python
File Size

The distribution of size of files (measured in lines of code).

Intro
  • File size measurements show the distribution of size of files.
  • Files are classified in four categories based on their size (lines of code): 1-100 (very small files), 101-200 (small files), 201-500 (medium size files), 501-1000 (long files), 1001+(very long files).
  • It is a good practice to keep files small. Long files may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
File Size Overall
  • There are 53 files with 6,760 lines of code.
    • 0 very long files (0 lines of code)
    • 2 long files (1,168 lines of code)
    • 11 medium size files (3,048 lines of code)
    • 8 small files (1,143 lines of code)
    • 32 very small files (1,401 lines of code)
0% | 17% | 45% | 16% | 20%
Legend:
1001+
501-1000
201-500
101-200
1-100


explore: grouped by folders | grouped by size | sunburst | 3D view
File Size per Extension
1001+
501-1000
201-500
101-200
1-100
py0% | 17% | 45% | 16% | 20%
File Size per Logical Decomposition
primary
1001+
501-1000
201-500
101-200
1-100
src0% | 17% | 45% | 16% | 20%
Longest Files (Top 50)
File# lines# units
guardrail_evals.py
in src/guardrails/evals
627 11
client.py
in src/guardrails
541 27
agents.py
in src/guardrails
408 14
pii.py
in src/guardrails/checks/text
372 11
llm_base.py
in src/guardrails/checks/text
309 6
_base_client.py
in src/guardrails
306 23
urls.py
in src/guardrails/checks/text
279 5
async_engine.py
in src/guardrails/evals/core
278 7
responses.py
in src/guardrails/resources/responses
255 5
conversation.py
in src/guardrails/utils
219 13
visualizer.py
in src/guardrails/evals/core
212 10
runtime.py
in src/guardrails
206 10
prompt_injection_detection.py
in src/guardrails/checks/text
204 6
secret_keys.py
in src/guardrails/checks/text
197 7
benchmark_reporter.py
in src/guardrails/evals/core
154 9
schema.py
in src/guardrails/utils
149 7
parsing.py
in src/guardrails/utils
147 9
types.py
in src/guardrails
140 7
hallucination_detection.py
in src/guardrails/checks/text
140 -
chat.py
in src/guardrails/resources/chat
115 7
moderation.py
in src/guardrails/checks/text
101 2
registry.py
in src/guardrails
100 8
_streaming.py
in src/guardrails
98 1
output.py
in src/guardrails/utils
93 9
benchmark_calculator.py
in src/guardrails/evals/core
92 7
create_vector_store.py
in src/guardrails/utils
92 -
json_reporter.py
in src/guardrails/evals/core
87 4
keywords.py
in src/guardrails/checks/text
65 2
latency_tester.py
in src/guardrails/evals/core
62 3
__init__.py
in src/guardrails
56 -
validate_dataset.py
in src/guardrails/evals/core
55 2
cli.py
in src/guardrails
53 2
types.py
in src/guardrails/evals/core
51 4
anonymizer.py
in src/guardrails/utils
49 2
calculator.py
in src/guardrails/evals/core
41 2
spec.py
in src/guardrails
40 2
__init__.py
in src/guardrails/evals/core
38 -
context.py
in src/guardrails/utils
38 2
jsonl_loader.py
in src/guardrails/evals/core
34 1
__init__.py
in src/guardrails/evals
32 1
competitors.py
in src/guardrails/checks/text
29 -
jailbreak.py
in src/guardrails/checks/text
28 -
exceptions.py
in src/guardrails
27 5
__init__.py
in src/guardrails/checks
26 -
safety_identifier.py
in src/guardrails/utils
23 1
user_defined_llm.py
in src/guardrails/checks/text
21 -
off_topic_prompts.py
in src/guardrails/checks/text
20 -
context.py
in src/guardrails
20 4
nsfw.py
in src/guardrails/checks/text
17 -
__init__.py
in src/guardrails/resources/chat
7 -
Files With Most Units (Top 39)
File# lines# units
client.py
in src/guardrails
541 27
_base_client.py
in src/guardrails
306 23
agents.py
in src/guardrails
408 14
conversation.py
in src/guardrails/utils
219 13
guardrail_evals.py
in src/guardrails/evals
627 11
pii.py
in src/guardrails/checks/text
372 11
visualizer.py
in src/guardrails/evals/core
212 10
runtime.py
in src/guardrails
206 10
benchmark_reporter.py
in src/guardrails/evals/core
154 9
parsing.py
in src/guardrails/utils
147 9
output.py
in src/guardrails/utils
93 9
registry.py
in src/guardrails
100 8
async_engine.py
in src/guardrails/evals/core
278 7
benchmark_calculator.py
in src/guardrails/evals/core
92 7
types.py
in src/guardrails
140 7
secret_keys.py
in src/guardrails/checks/text
197 7
schema.py
in src/guardrails/utils
149 7
chat.py
in src/guardrails/resources/chat
115 7
prompt_injection_detection.py
in src/guardrails/checks/text
204 6
llm_base.py
in src/guardrails/checks/text
309 6
exceptions.py
in src/guardrails
27 5
urls.py
in src/guardrails/checks/text
279 5
responses.py
in src/guardrails/resources/responses
255 5
json_reporter.py
in src/guardrails/evals/core
87 4
types.py
in src/guardrails/evals/core
51 4
context.py
in src/guardrails
20 4
latency_tester.py
in src/guardrails/evals/core
62 3
validate_dataset.py
in src/guardrails/evals/core
55 2
calculator.py
in src/guardrails/evals/core
41 2
moderation.py
in src/guardrails/checks/text
101 2
keywords.py
in src/guardrails/checks/text
65 2
anonymizer.py
in src/guardrails/utils
49 2
context.py
in src/guardrails/utils
38 2
spec.py
in src/guardrails
40 2
cli.py
in src/guardrails
53 2
jsonl_loader.py
in src/guardrails/evals/core
34 1
__init__.py
in src/guardrails/evals
32 1
safety_identifier.py
in src/guardrails/utils
23 1
_streaming.py
in src/guardrails
98 1
Files With Long Lines (Top 21)

There are 21 files with lines longer than 120 characters. In total, there are 73 long lines.

File# lines# units# long lines
agents.py
in src/guardrails
408 14 14
guardrail_evals.py
in src/guardrails/evals
627 11 13
async_engine.py
in src/guardrails/evals/core
278 7 6
pii.py
in src/guardrails/checks/text
372 11 6
_base_client.py
in src/guardrails
306 23 6
client.py
in src/guardrails
541 27 4
visualizer.py
in src/guardrails/evals/core
212 10 3
responses.py
in src/guardrails/resources/responses
255 5 3
benchmark_reporter.py
in src/guardrails/evals/core
154 9 2
benchmark_calculator.py
in src/guardrails/evals/core
92 7 2
prompt_injection_detection.py
in src/guardrails/checks/text
204 6 2
llm_base.py
in src/guardrails/checks/text
309 6 2
chat.py
in src/guardrails/resources/chat
115 7 2
calculator.py
in src/guardrails/evals/core
41 2 1
registry.py
in src/guardrails
100 8 1
urls.py
in src/guardrails/checks/text
279 5 1
secret_keys.py
in src/guardrails/checks/text
197 7 1
user_defined_llm.py
in src/guardrails/checks/text
21 - 1
conversation.py
in src/guardrails/utils
219 13 1
context.py
in src/guardrails/utils
38 2 1
runtime.py
in src/guardrails
206 10 1
Correlations

File Size vs. Commits (all time): 53 points

src/guardrails/_base_client.py x: 11 commits (all time) y: 306 lines of code src/guardrails/checks/text/llm_base.py x: 14 commits (all time) y: 309 lines of code src/guardrails/checks/text/moderation.py x: 8 commits (all time) y: 101 lines of code src/guardrails/checks/text/pii.py x: 12 commits (all time) y: 372 lines of code src/guardrails/checks/text/prompt_injection_detection.py x: 15 commits (all time) y: 204 lines of code src/guardrails/checks/text/jailbreak.py x: 10 commits (all time) y: 28 lines of code src/guardrails/checks/text/hallucination_detection.py x: 17 commits (all time) y: 140 lines of code src/guardrails/checks/text/nsfw.py x: 3 commits (all time) y: 17 lines of code src/guardrails/checks/text/off_topic_prompts.py x: 6 commits (all time) y: 20 lines of code src/guardrails/evals/core/benchmark_reporter.py x: 6 commits (all time) y: 154 lines of code src/guardrails/__init__.py x: 7 commits (all time) y: 56 lines of code src/guardrails/agents.py x: 12 commits (all time) y: 408 lines of code src/guardrails/checks/text/urls.py x: 8 commits (all time) y: 279 lines of code src/guardrails/client.py x: 10 commits (all time) y: 541 lines of code src/guardrails/evals/core/async_engine.py x: 10 commits (all time) y: 278 lines of code src/guardrails/types.py x: 10 commits (all time) y: 140 lines of code src/guardrails/utils/anonymizer.py x: 2 commits (all time) y: 49 lines of code src/guardrails/resources/chat/chat.py x: 9 commits (all time) y: 115 lines of code src/guardrails/resources/responses/responses.py x: 9 commits (all time) y: 255 lines of code src/guardrails/evals/core/visualizer.py x: 6 commits (all time) y: 212 lines of code src/guardrails/evals/guardrail_evals.py x: 10 commits (all time) y: 627 lines of code src/guardrails/checks/text/keywords.py x: 7 commits (all time) y: 65 lines of code src/guardrails/spec.py x: 3 commits (all time) y: 40 lines of code src/guardrails/checks/text/secret_keys.py x: 8 commits (all time) y: 197 lines of code src/guardrails/utils/safety_identifier.py x: 2 commits (all time) y: 23 lines of code src/guardrails/runtime.py x: 7 commits (all time) y: 206 lines of code src/guardrails/utils/create_vector_store.py x: 6 commits (all time) y: 92 lines of code src/guardrails/evals/core/types.py x: 6 commits (all time) y: 51 lines of code src/guardrails/_streaming.py x: 6 commits (all time) y: 98 lines of code src/guardrails/utils/__init__.py x: 3 commits (all time) y: 1 lines of code src/guardrails/utils/conversation.py x: 1 commits (all time) y: 219 lines of code src/guardrails/evals/__init__.py x: 5 commits (all time) y: 32 lines of code src/guardrails/cli.py x: 5 commits (all time) y: 53 lines of code src/guardrails/context.py x: 5 commits (all time) y: 20 lines of code src/guardrails/evals/core/benchmark_calculator.py x: 5 commits (all time) y: 92 lines of code src/guardrails/evals/core/calculator.py x: 5 commits (all time) y: 41 lines of code src/guardrails/evals/core/jsonl_loader.py x: 5 commits (all time) y: 34 lines of code src/guardrails/evals/core/latency_tester.py x: 5 commits (all time) y: 62 lines of code src/guardrails/registry.py x: 3 commits (all time) y: 100 lines of code src/guardrails/utils/context.py x: 3 commits (all time) y: 38 lines of code src/guardrails/utils/schema.py x: 3 commits (all time) y: 149 lines of code src/guardrails/checks/__init__.py x: 4 commits (all time) y: 26 lines of code src/guardrails/checks/text/competitors.py x: 4 commits (all time) y: 29 lines of code src/guardrails/evals/core/json_reporter.py x: 4 commits (all time) y: 87 lines of code src/guardrails/evals/core/validate_dataset.py x: 4 commits (all time) y: 55 lines of code src/guardrails/resources/chat/__init__.py x: 4 commits (all time) y: 7 lines of code src/guardrails/checks/text/__init__.py x: 2 commits (all time) y: 1 lines of code src/guardrails/evals/core/__init__.py x: 2 commits (all time) y: 38 lines of code src/guardrails/exceptions.py x: 2 commits (all time) y: 27 lines of code src/guardrails/utils/output.py x: 2 commits (all time) y: 93 lines of code src/guardrails/utils/parsing.py x: 2 commits (all time) y: 147 lines of code
627.0
lines of code
  min: 1.0
  average: 127.55
  25th percentile: 30.5
  median: 87.0
  75th percentile: 200.5
  max: 627.0
0 17.0
commits (all time)
min: 1.0 | average: 6.19 | 25th percentile: 3.0 | median: 5.0 | 75th percentile: 8.5 | max: 17.0

File Size vs. Contributors (all time): 53 points

src/guardrails/_base_client.py x: 4 contributors (all time) y: 306 lines of code src/guardrails/checks/text/llm_base.py x: 4 contributors (all time) y: 309 lines of code src/guardrails/checks/text/moderation.py x: 4 contributors (all time) y: 101 lines of code src/guardrails/checks/text/pii.py x: 4 contributors (all time) y: 372 lines of code src/guardrails/checks/text/prompt_injection_detection.py x: 4 contributors (all time) y: 204 lines of code src/guardrails/checks/text/jailbreak.py x: 4 contributors (all time) y: 28 lines of code src/guardrails/checks/text/hallucination_detection.py x: 5 contributors (all time) y: 140 lines of code src/guardrails/checks/text/nsfw.py x: 3 contributors (all time) y: 17 lines of code src/guardrails/checks/text/off_topic_prompts.py x: 4 contributors (all time) y: 20 lines of code src/guardrails/evals/core/benchmark_reporter.py x: 4 contributors (all time) y: 154 lines of code src/guardrails/__init__.py x: 4 contributors (all time) y: 56 lines of code src/guardrails/agents.py x: 4 contributors (all time) y: 408 lines of code src/guardrails/checks/text/urls.py x: 4 contributors (all time) y: 279 lines of code src/guardrails/client.py x: 4 contributors (all time) y: 541 lines of code src/guardrails/evals/core/async_engine.py x: 4 contributors (all time) y: 278 lines of code src/guardrails/types.py x: 4 contributors (all time) y: 140 lines of code src/guardrails/utils/anonymizer.py x: 1 contributors (all time) y: 49 lines of code src/guardrails/resources/chat/chat.py x: 5 contributors (all time) y: 115 lines of code src/guardrails/resources/responses/responses.py x: 5 contributors (all time) y: 255 lines of code src/guardrails/evals/core/visualizer.py x: 4 contributors (all time) y: 212 lines of code src/guardrails/evals/guardrail_evals.py x: 4 contributors (all time) y: 627 lines of code src/guardrails/checks/text/keywords.py x: 4 contributors (all time) y: 65 lines of code src/guardrails/spec.py x: 3 contributors (all time) y: 40 lines of code src/guardrails/checks/text/secret_keys.py x: 4 contributors (all time) y: 197 lines of code src/guardrails/utils/safety_identifier.py x: 1 contributors (all time) y: 23 lines of code src/guardrails/runtime.py x: 4 contributors (all time) y: 206 lines of code src/guardrails/utils/create_vector_store.py x: 4 contributors (all time) y: 92 lines of code src/guardrails/evals/core/types.py x: 4 contributors (all time) y: 51 lines of code src/guardrails/_streaming.py x: 4 contributors (all time) y: 98 lines of code src/guardrails/utils/__init__.py x: 3 contributors (all time) y: 1 lines of code src/guardrails/utils/conversation.py x: 1 contributors (all time) y: 219 lines of code src/guardrails/evals/__init__.py x: 4 contributors (all time) y: 32 lines of code src/guardrails/cli.py x: 4 contributors (all time) y: 53 lines of code src/guardrails/evals/core/calculator.py x: 4 contributors (all time) y: 41 lines of code src/guardrails/evals/core/jsonl_loader.py x: 4 contributors (all time) y: 34 lines of code src/guardrails/evals/core/latency_tester.py x: 4 contributors (all time) y: 62 lines of code src/guardrails/registry.py x: 3 contributors (all time) y: 100 lines of code src/guardrails/utils/context.py x: 3 contributors (all time) y: 38 lines of code src/guardrails/utils/schema.py x: 3 contributors (all time) y: 149 lines of code src/guardrails/checks/__init__.py x: 3 contributors (all time) y: 26 lines of code src/guardrails/checks/text/competitors.py x: 3 contributors (all time) y: 29 lines of code src/guardrails/evals/core/json_reporter.py x: 3 contributors (all time) y: 87 lines of code src/guardrails/evals/core/validate_dataset.py x: 3 contributors (all time) y: 55 lines of code src/guardrails/resources/chat/__init__.py x: 3 contributors (all time) y: 7 lines of code src/guardrails/checks/text/__init__.py x: 2 contributors (all time) y: 1 lines of code src/guardrails/evals/core/__init__.py x: 2 contributors (all time) y: 38 lines of code src/guardrails/exceptions.py x: 2 contributors (all time) y: 27 lines of code src/guardrails/utils/output.py x: 2 contributors (all time) y: 93 lines of code src/guardrails/utils/parsing.py x: 2 contributors (all time) y: 147 lines of code
627.0
lines of code
  min: 1.0
  average: 127.55
  25th percentile: 30.5
  median: 87.0
  75th percentile: 200.5
  max: 627.0
0 5.0
contributors (all time)
min: 1.0 | average: 3.47 | 25th percentile: 3.0 | median: 4.0 | 75th percentile: 4.0 | max: 5.0

File Size vs. Commits (30 days): 0 points

No data for "commits (30d)" vs. "lines of code".

File Size vs. Contributors (30 days): 0 points

No data for "contributors (30d)" vs. "lines of code".


File Size vs. Commits (90 days): 5 points

src/guardrails/_base_client.py x: 1 commits (90d) y: 306 lines of code src/guardrails/checks/text/llm_base.py x: 1 commits (90d) y: 309 lines of code src/guardrails/checks/text/moderation.py x: 1 commits (90d) y: 101 lines of code src/guardrails/checks/text/pii.py x: 1 commits (90d) y: 372 lines of code src/guardrails/checks/text/prompt_injection_detection.py x: 1 commits (90d) y: 204 lines of code
372.0
lines of code
  min: 101.0
  average: 258.4
  25th percentile: 152.5
  median: 306.0
  75th percentile: 340.5
  max: 372.0
0 1.0
commits (90d)
min: 1.0 | average: 1.0 | 25th percentile: 1.0 | median: 1.0 | 75th percentile: 1.0 | max: 1.0

File Size vs. Contributors (90 days): 5 points

src/guardrails/_base_client.py x: 1 contributors (90d) y: 306 lines of code src/guardrails/checks/text/llm_base.py x: 1 contributors (90d) y: 309 lines of code src/guardrails/checks/text/moderation.py x: 1 contributors (90d) y: 101 lines of code src/guardrails/checks/text/pii.py x: 1 contributors (90d) y: 372 lines of code src/guardrails/checks/text/prompt_injection_detection.py x: 1 contributors (90d) y: 204 lines of code
372.0
lines of code
  min: 101.0
  average: 258.4
  25th percentile: 152.5
  median: 306.0
  75th percentile: 340.5
  max: 372.0
0 1.0
contributors (90d)
min: 1.0 | average: 1.0 | 25th percentile: 1.0 | median: 1.0 | 75th percentile: 1.0 | max: 1.0