codePost Statistics Compiler
A system to compile statistics automatically from a course on the codePost platform.
Installation
The package is available on PyPI as slacktivate and so is available the usual way, i.e.,
$ pip install codepost-stats
Example
import codepost
import codepost_stats
import codepost_stats.analyzers.abstract.simple
import codepost_stats.analyzers.standard
import codepost_stats.event_loop
# Login
codepost.configure_api_key("<CODEPOST_API_TOKEN>")
# Create Course Analyzer Event Loop
cael = codepost_stats.event_loop.CourseAnalyzerEventLoop(
course_name="COS126",
course_term="S2020",
)
# Create Analyzer
class SubmissionsGradedCounter(codepost_stats.analyzers.abstract.simple.CounterAnalyzer):
_name = "submissions.graded"
def _event_submission(
self,
assignment: codepost.models.assignments.Assignments,
submission: codepost.models.submissions.Submissions,
):
# if no grader, nothing to do
if submission.grader is None:
return
# if not finalized, do not want to count it
if not submission.isFinalized:
return
# increase number of graded submission for grader by 1
self._delta_counter(
name=submission.grader,
subcat=assignment.name,
delta=1,
)
sgc = SubmissionsGradedCounter()
# Add the analyzer we just created
cael.register(sgc)
# Add a few standard analyzers
cael.register(codepost_stats.analyzers.standard.CustomCommentsCounter)
cael.register(codepost_stats.analyzers.standard.RubricCommentsCounter)
# Run the aggregation of stats
cael.run()
# Extract statistics per user
statistics_per_user = {
name: cael.get_by_name(name)
for name in cael.names
}
and the statistics_per_user variable would be a dictionary of the form:
{
"grader1@princeton.edu": {
"submissions.graded": {
"hello": 5,
"loops": 6,
"nbody": 0,
"sierpinski": 8,
"programming-exam-1": 6,
"hamming": 0,
"lfsr": 2,
"guitar": 5,
"markov": 6,
"tspp": 4,
"atomic": 29
},
"comments.counter.custom": {
"hello": 9,
"loops": 6,
"nbody": 0,
"sierpinski": 14,
"programming-exam-1": 6,
"hamming": 0,
"lfsr": 4,
"guitar": 8,
"markov": 14,
"tspp": 7,
"atomic": 36
},
"comments.counter.rubric": {
"hello": 7,
"loops": 15,
"nbody": 0,
"sierpinski": 13,
"programming-exam-1": 8,
"hamming": 0,
"lfsr": 6,
"guitar": 10,
"markov": 17,
"tspp": 13,
"atomic": 38
}
},
"grader2@princeton.edu": {
/* ... grader2@princeton.edu's statistics here ... */
},
/* ... more graders ... */
}
License
This project is licensed under the LGPLv3 license, with the understanding that importing a Python modular is similar in spirit to dynamically linking against it.
-
You can use the library/CLI
codepost-statsin any project, for any purpose, as long as you provide some acknowledgement to this original project for use of the library (for open source software, just explicitly includingcodepost-statsin the dependency such as apyproject.tomlorPipfileis acknowledgement enough for me!). -
If you make improvements to
codepost-stats, you are required to make those changes publicly available.
Metadata
Release files for codepost-stats 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codepost-stats-0.1.4.tar.gz | 18.1 kB | Without provenance | Details for codepost-stats-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codepost_stats-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for codepost_stats-0.1.4-py3-none-any.whl |
Total release size: 40.0 kB
Release files / codepost-stats-0.1.4.tar.gz
| Download URL | codepost-stats-0.1.4.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef8ba7edeb10d66b11ac24e315f0eef289b3f72ed4b26c29a420c77f484f40c9
|
|
BLAKE2b-256 checksum How to use checksums |
85a7899d602fe04771ad134fc5dbad3f3b3997e5dff5a0fae1fecfda6fe0ce9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.4 Darwin/21.4.0
|
Release files / codepost_stats-0.1.4-py3-none-any.whl
| Download URL | codepost_stats-0.1.4-py3-none-any.whl |
|---|---|
| Size | 22.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4287ebc8a4b8316277defeb3e5671eab950445ad01c49f66e6f2921fb3ae9b6
|
|
BLAKE2b-256 checksum How to use checksums |
344342f2cbf7f51017a197558d307684a8e16ec8fba5473f080fe45e04056d21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.4 Darwin/21.4.0
|
Security for codepost-stats 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.