Skip to main content

apiverve_codedetector 1.2.2 copy "apiverve_codedetector: ^1.2.2" to clipboard
apiverve_codedetector: ^1.2.2 copied to clipboard

Code Detector identifies the programming language of any submitted code snippet. It returns the canonical language name, readable title, and standard file extension for the detected code.

Code Detector API - Dart/Flutter Client #

Code Detector identifies the programming language of any submitted code snippet. It returns the canonical language name, readable title, and standard file extension for the detected code.

pub package License: MIT

This is the Dart/Flutter client for the Code Detector API.

Installation #

Add this to your pubspec.yaml:

dependencies:
  apiverve_codedetector: ^1.2.2

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage #

import 'package:apiverve_codedetector/apiverve_codedetector.dart';

void main() async {
  final client = CodedetectorClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'code': 'a = 5
b = 6
c = 7

# calculate the semi-perimeter
s = (a + b + c) / 2

# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print(\'The area of the triangle is %0.2f\' %area)'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response #

{
  "status": "ok",
  "error": null,
  "data": {
    "likelihood": 0.99,
    "family": "PYTHON",
    "current": "python",
    "readable": "Python Code",
    "extension": ".py",
    "paradigm": "multi-paradigm",
    "isCompiled": false
  }
}

API Reference #

Authentication #

All requests require an API key. Get yours at apiverve.com.

License #

MIT License - see LICENSE for details.


Built with Dart for APIVerve

0
likes
130
points
131
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Code Detector identifies the programming language of any submitted code snippet. It returns the canonical language name, readable title, and standard file extension for the detected code.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

http, http_parser

More

Packages that depend on apiverve_codedetector